OnMove.cs 916 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System;
  4. using System.Linq;
  5. using UnityEngine;
  6. public partial class CardEffectCommons
  7. {
  8. #region Can trigger "when permanent moves" effect
  9. public static bool CanTriggerOnMove(Hashtable hashtable, Func<Permanent, bool> permanentCondition)
  10. {
  11. Permanent permanent = GetMovedPermanentFromHashtable(hashtable);
  12. if (permanent != null)
  13. {
  14. if (IsPermanentExistsOnBattleArea(permanent))
  15. {
  16. if (permanentCondition == null || permanentCondition(permanent))
  17. {
  18. return true;
  19. }
  20. }
  21. }
  22. return false;
  23. }
  24. #endregion
  25. #region Get moved permanent
  26. public static Permanent GetMovedPermanentFromHashtable(Hashtable hashtable)
  27. {
  28. return GetPermanentFromHashtable(hashtable);
  29. }
  30. #endregion
  31. }