CanNotEvolveClass.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System;
  5. public class CanNotDigivolveClass : ICardEffect, ICanNotDigivolveEffect
  6. {
  7. Func<Permanent, bool> _PermanentCondition { get; set; }
  8. Func<CardSource, bool> _CardCondition { get; set; }
  9. public void SetUpCanNotEvolveClass(Func<Permanent, bool> permanentCondition, Func<CardSource, bool> cardCondition)
  10. {
  11. _PermanentCondition = permanentCondition;
  12. _CardCondition = cardCondition;
  13. }
  14. public bool CanNotEvolve(Permanent permanent, CardSource cardSource)
  15. {
  16. if (permanent != null && cardSource != null)
  17. {
  18. if (permanent.TopCard != null)
  19. {
  20. if (_PermanentCondition != null && _CardCondition != null)
  21. {
  22. if (_PermanentCondition(permanent) && _CardCondition(cardSource))
  23. {
  24. return true;
  25. }
  26. }
  27. }
  28. }
  29. return false;
  30. }
  31. }