diff --git a/src/tools/coordinate.py b/src/tools/coordinate.py index 5c9c538..e5e78d5 100644 --- a/src/tools/coordinate.py +++ b/src/tools/coordinate.py @@ -261,6 +261,12 @@ class Coordinate(tuple): else: return self.__class__(-self[0], -self[1], -self[2]) + def __eq__(self, other: Coordinate | tuple) -> bool: + if self[2] is None: + return self[0] == other[0] and self[1] == other[1] + else: + return self[0] == other[0] and self[1] == other[1] and self[2] == other[2] + def __add__(self, other: Coordinate | tuple) -> Coordinate: if self[2] is None: return self.__class__(self[0] + other[0], self[1] + other[1])