LevelCondition.lua 694 B

123456789101112131415161718192021222324252627282930
  1. ---@class LevelCondition
  2. LevelCondition = class(ConditionBase)
  3. LevelCondition.comparatorMap = {
  4. [0] = function(self)
  5. return SL:MeData_GetLevel() > self.param
  6. end,
  7. [1] = function(self)
  8. return SL:MeData_GetLevel() >= self.param
  9. end,
  10. [2] = function(self)
  11. return SL:MeData_GetLevel() == self.param
  12. end,
  13. [3] = function(self)
  14. return SL:MeData_GetLevel() <= self.param
  15. end,
  16. [4] = function(self)
  17. return SL:MeData_GetLevel() < self.param
  18. end,
  19. [5] = function(self)
  20. return SL:MeData_GetLevel() ~= self.param
  21. end,
  22. }
  23. function LevelCondition:InitParam(param)
  24. self.param = tonumber(param)
  25. end