using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Linq; using Photon; using System; using Photon.Pun; public class ImmuneStackTrashingClass : ICardEffect, IImmuneFromStackTrashingEffect { Func PermanentCondition { get; set; } Func EffectCondition { get; set; } public void SetUpImmuneFromStackTrashingClass(Func PermanentCondition, Func EffectCondition) { this.PermanentCondition = PermanentCondition; this.EffectCondition = EffectCondition; } public bool ImmuneStackTrashing(Permanent permanent, ICardEffect effect) { if (permanent != null) { if (permanent.TopCard != null) { if (EffectCondition != null) { if (!EffectCondition(effect)) { return false; } } if (PermanentCondition != null) { if (!PermanentCondition(permanent)) { return false; } } return true; } } return false; } }