WhenPermanentWouldPlay.cs 774 B

12345678910111213141516171819202122232425262728293031
  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 would be played" effects of 1 permanent
  9. public static bool CanTriggerWhenPermanentWouldPlay(Hashtable hashtable, Func<CardSource, bool> cardCondition)
  10. {
  11. bool IsEvolution = CardEffectCommons.IsEvolution(hashtable);
  12. if (!IsEvolution)
  13. {
  14. CardSource Card = GetCardFromHashtable(hashtable);
  15. if (Card != null)
  16. {
  17. if (cardCondition == null || cardCondition(Card))
  18. {
  19. return true;
  20. }
  21. }
  22. }
  23. return false;
  24. }
  25. #endregion
  26. }