Conditions.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using CommonLang.Property;
  5. using CommonAI.Zone.ZoneEditor;
  6. using CommonAI.Zone.EventTrigger;
  7. namespace CommonAI.Zone.ZoneEditor.EventTrigger
  8. {
  9. //-------------------------------------------------------------------
  10. [DescAttribute("总是可以", "布尔")]
  11. public class AlwaysTrue : AbstractCondition
  12. {
  13. public override string ToString()
  14. {
  15. return "总是可以";
  16. }
  17. public override bool Test(EventTriggerAdapter api, EventArguments args)
  18. {
  19. return true;
  20. }
  21. }
  22. [DescAttribute("布尔条件", "布尔")]
  23. public class BooleanCondition : AbstractCondition
  24. {
  25. [DescAttribute("布尔值")]
  26. public BooleanValue Value = new BooleanValue.BooleanComparison();
  27. public override string ToString()
  28. {
  29. return Value.ToString();
  30. }
  31. public override bool Test(EventTriggerAdapter api, EventArguments args)
  32. {
  33. return Value.GetValue(api, args);
  34. }
  35. }
  36. }