using System.Collections; using System.Collections.Generic; using UnityEngine; using System; public class CanNotSelectBySkillClass : ICardEffect, ICanNotSelectBySkillEffect { Func PermanentCondition { get; set; } Func CardEffectCondition { get; set; } public void SetUpCanNotSelectBySkillClass(Func PermanentCondition, Func CardEffectCondition) { this.PermanentCondition = PermanentCondition; this.CardEffectCondition = CardEffectCondition; } public bool CanNotSelectBySkill(Permanent permanent, ICardEffect cardEffect) { if (permanent != null && permanent.TopCard != null && cardEffect != null && cardEffect.EffectSourceCard != null) { if (PermanentCondition != null && CardEffectCondition != null) { if (PermanentCondition(permanent) && CardEffectCondition(cardEffect)) { return true; } } } return false; } }