1.1.0.rc2 #342

Merged
edraft merged 9 commits from 1.1.0.rc2 into 1.1.0 2023-08-16 19:09:05 +02:00
Showing only changes of commit 44f6b36347 - Show all commits

View File

@ -60,13 +60,20 @@ class AchievementService:
self._operators = {
"==": lambda value, expected_value: value == expected_value,
"!=": lambda value, expected_value: value != expected_value,
"<=": lambda value, expected_value: value <= expected_value,
">=": lambda value, expected_value: value >= expected_value,
"<": lambda value, expected_value: value < expected_value,
">": lambda value, expected_value: value > expected_value,
"<=": lambda value, expected_value: self._num(value) <= self._num(expected_value),
">=": lambda value, expected_value: self._num(value) >= self._num(expected_value),
"<": lambda value, expected_value: self._num(value) < self._num(expected_value),
">": lambda value, expected_value: self._num(value) > self._num(expected_value),
"contains": lambda value, expected_value: expected_value in value,
}
@staticmethod
def _num(s: str):
try:
return int(s)
except ValueError:
return float(s)
def add_achievement_attribute(self, atr: AchievementAttribute):
self._attributes.add(atr)