TreatAsDigimonClass.cs 730 B

1234567891011121314151617181920212223242526272829
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System;
  5. public class TreatAsDigimonClass : ICardEffect, ITreatAsDigimonEffect
  6. {
  7. Func<Permanent, bool> PermanentCondition { get; set; }
  8. public void SetUpTreatAsDigimonClass(Func<Permanent, bool> permanentCondition)
  9. {
  10. this.PermanentCondition = permanentCondition;
  11. }
  12. public bool IsDigimon(Permanent permanent)
  13. {
  14. if (PermanentCondition != null && permanent != null)
  15. {
  16. if (permanent.TopCard != null)
  17. {
  18. if (PermanentCondition(permanent))
  19. {
  20. return true;
  21. }
  22. }
  23. }
  24. return false;
  25. }
  26. }