CannotBlockClass.cs 974 B

1234567891011121314151617181920212223242526272829303132
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System;
  5. public class CannotBlockClass : ICardEffect, ICannotBlockEffect
  6. {
  7. Func<Permanent, Permanent, bool> _permanentsCondition = null;
  8. public void SetUpCannotBlockClass(Func<Permanent, Permanent, bool> permanentsCondition)
  9. {
  10. _permanentsCondition = permanentsCondition;
  11. }
  12. public bool CannotBlock(Permanent attackingPermanent, Permanent defendingPermanent)
  13. {
  14. if (CardEffectCommons.IsPermanentExistsOnBattleArea(attackingPermanent))
  15. {
  16. if (CardEffectCommons.IsPermanentExistsOnBattleArea(defendingPermanent))
  17. {
  18. if (_permanentsCondition != null)
  19. {
  20. if (_permanentsCondition(attackingPermanent, defendingPermanent))
  21. {
  22. return true;
  23. }
  24. }
  25. }
  26. }
  27. return false;
  28. }
  29. }