mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Options: implement __eq__ assert for possible checks
This commit is contained in:
@@ -149,8 +149,10 @@ class Choice(Option):
|
|||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
if type(other) == str:
|
if type(other) == str:
|
||||||
|
assert other in self.options
|
||||||
return other == self.current_key
|
return other == self.current_key
|
||||||
elif type(other) == int:
|
elif type(other) == int:
|
||||||
|
assert other in self.name_lookup
|
||||||
return other == self.value
|
return other == self.value
|
||||||
elif type(other) == bool:
|
elif type(other) == bool:
|
||||||
return other == bool(self.value)
|
return other == bool(self.value)
|
||||||
|
Reference in New Issue
Block a user