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

public class SkillTargetDestroyedThisTurnCardListFilter : 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) => p.SkillInfoNecromanceZoneCards.Where((IReadOnlyBattleCardInfo pp) => pp.IsDead && !(pp is NullBattleCard) && pp.DestroyedTurn == turn && pp.IsDestroySelfTurn == isSelfTurn)));
		list.AddRange(battlePlayerInfos.SelectMany((IBattlePlayerReadOnlyInfo p) => p.SkillInfoCemeterys.Where((IReadOnlyBattleCardInfo pp) => pp.IsDead && !(pp is NullBattleCard) && pp.DestroyedTurn == turn && pp.IsDestroySelfTurn == isSelfTurn)));
		return list;
	}
}
