using System.Linq;
using Wizard;
using Wizard.Battle;

public class SkillConditionHealingCardIsClass : ISkillConditionChecker
{
	private BattleCardBase _ownerCard;

	private bool _isSelf;

	public SkillConditionHealingCardIsClass(BattleCardBase ownerCard, bool isSelf)
	{
		_ownerCard = ownerCard;
		_isSelf = isSelf;
	}

	public bool IsRight(BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option, bool PreexecutionCheck = false)
	{
		if (!_isSelf)
		{
			return playerInfoPair.ReadOnlyOpponent.SkillInfoHealingCards.Any((IReadOnlyBattleCardInfo c) => c == _ownerCard.OpponentBattlePlayer.Class);
		}
		return playerInfoPair.ReadOnlySelf.SkillInfoHealingCards.Any((IReadOnlyBattleCardInfo c) => c == _ownerCard.SelfBattlePlayer.Class);
	}

	public bool IsRightPrePlay(BattlePlayerReadOnlyInfoPair playerInfoPair, SkillConditionCheckerOption option, bool PreexecutionCheck = false)
	{
		return IsRight(playerInfoPair, option);
	}
}
