using System.Collections.Generic;
using System.Linq;
using Wizard.Battle;

public class SkillTargetReturnThisTurnCardListFilter : ISkillTargetFilter
{
	public IEnumerable<IReadOnlyBattleCardInfo> Filtering(IEnumerable<IBattlePlayerReadOnlyInfo> battlePlayerInfos, SkillConditionCheckerOption option)
	{
		List<IReadOnlyBattleCardInfo> list = new List<IReadOnlyBattleCardInfo>();
		BattleManagerBase ins = BattleManagerBase.GetIns();
		int turn = ins.CurrentTurn;
		bool isSelfTurn = ins.BattlePlayer.IsSelfTurn;
		list.AddRange(battlePlayerInfos.SelectMany((IBattlePlayerReadOnlyInfo p) => from pp in p.SkillInfoReturnedCards
			where pp.Turn == turn && pp.IsSelfTurn == isSelfTurn
			select pp.Card));
		return list;
	}
}
