CanNotSuspendClass.cs 802 B

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