diff --git a/coc/abc.py b/coc/abc.py index d5fd39b0..0bf627d7 100644 --- a/coc/abc.py +++ b/coc/abc.py @@ -171,6 +171,13 @@ def __init__(self, data, townhall): self._townhall = townhall + def __eq__(self, other): + return self.name == other.name and self.level == other.level \ + and self.village == other.village and self.is_active == other.is_active + + def __hash__(self): + return hash((self.name, self.level, self.village, self.is_active)) + def __repr__(self): attrs = [ ("name", self.name),