CanSelectDigiXrosClass.cs 1006 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System.Linq;
  5. using Photon;
  6. using System;
  7. public class CanSelectDigiXrosClass : ICardEffect, ICanSelectDigiXrosEffect
  8. {
  9. public void SetUpCanSelectDigiXrosClass(Func<CardSource, Permanent, bool> CanSelectCondition)
  10. {
  11. this.CanSelectCondition = CanSelectCondition;
  12. }
  13. Func<CardSource, Permanent, bool> CanSelectCondition { get; set; }
  14. public bool CanSelect(CardSource cardSource, Permanent permanent)
  15. {
  16. if (CanSelectCondition != null)
  17. {
  18. if (permanent != null)
  19. {
  20. if (permanent.TopCard != null)
  21. {
  22. if (cardSource != null)
  23. {
  24. if (CanSelectCondition(cardSource, permanent))
  25. {
  26. return true;
  27. }
  28. }
  29. }
  30. }
  31. }
  32. return false;
  33. }
  34. }