Skip to content

Commit

Permalink
add equal
Browse files Browse the repository at this point in the history
  • Loading branch information
edenhaus committed Nov 29, 2021
1 parent ddd79f8 commit fa4f2b9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deebot_client/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,12 @@ def __hash__(self) -> int:
"""Calculate hash on index and crc32."""
return hash(self._index) + hash(self._crc32)

def __eq__(self, obj: object) -> bool:
if not isinstance(obj, MapPiece):
return False

return self._crc32 == obj._crc32 and self._index == obj._index


class DashedImageDraw(ImageDraw.ImageDraw): # type: ignore
"""Class extend ImageDraw by dashed line."""
Expand Down

0 comments on commit fa4f2b9

Please sign in to comment.