AddDetailClass.cs 869 B

12345678910111213141516171819202122232425262728293031323334
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System;
  4. public class AddDetailClass : ICardEffect, IAddDetailEffect
  5. {
  6. Func<Permanent, bool> _permanentCondition = null;
  7. string _detail = null;
  8. bool _triggerEffect = false;
  9. public void SetUpAddDetailClass(Func<Permanent, bool> permanentCondition, string detail, bool triggerEffect)
  10. {
  11. _permanentCondition = permanentCondition;
  12. _detail = detail;
  13. _triggerEffect = triggerEffect;
  14. }
  15. public bool PermanentCondition(Permanent permanent)
  16. {
  17. return _permanentCondition != null
  18. && permanent != null
  19. && permanent.TopCard != null
  20. && _permanentCondition(permanent);
  21. }
  22. public string GetDetail()
  23. {
  24. return _detail;
  25. }
  26. public bool TriggerEffect()
  27. {
  28. return _triggerEffect;
  29. }
  30. }