AllianceClass.cs 818 B

1234567891011121314151617181920212223242526272829303132333435
  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 AllianceClass : ICardEffect, IAllianceEffect
  8. {
  9. public void SetUpAllianceClass(Func<Permanent, bool> PermanentCondition)
  10. {
  11. this.PermanentCondition = PermanentCondition;
  12. }
  13. Func<Permanent, bool> PermanentCondition { get; set; }
  14. public bool HasAlliance(Permanent permanent)
  15. {
  16. if (PermanentCondition != null)
  17. {
  18. if (permanent != null)
  19. {
  20. if (permanent.TopCard != null)
  21. {
  22. if (PermanentCondition(permanent))
  23. {
  24. return true;
  25. }
  26. }
  27. }
  28. }
  29. return false;
  30. }
  31. }