make Item hashable

This commit is contained in:
Fabian Dill 2021-01-02 12:59:19 +01:00
parent f3b6be2b20
commit 938ccccbd4
1 changed files with 3 additions and 0 deletions

View File

@ -1041,6 +1041,9 @@ class Item(object):
def __eq__(self, other):
return self.name == other.name and self.player == other.player
def __hash__(self):
return hash((self.name, self.player))
@property
def crystal(self) -> bool:
return self.type == 'Crystal'