summaryrefslogtreecommitdiff
path: root/cameltris/coordinates.py
diff options
context:
space:
mode:
authorOlivier Gayot <olivier.gayot@sigexec.com>2021-11-13 12:05:18 +0100
committerOlivier Gayot <olivier.gayot@sigexec.com>2021-11-13 16:58:31 +0100
commitf4049ca3bbd79c2c6568e519cde92836cc79769a (patch)
treefde18ce64554c16981b57450f73b6e752146631d /cameltris/coordinates.py
parentc21660de843d0082f5fd1e5a4d3927f52ecb106e (diff)
Add optional coordinates to a piece
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
Diffstat (limited to 'cameltris/coordinates.py')
-rw-r--r--cameltris/coordinates.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/cameltris/coordinates.py b/cameltris/coordinates.py
new file mode 100644
index 0000000..a5cee80
--- /dev/null
+++ b/cameltris/coordinates.py
@@ -0,0 +1,11 @@
+from dataclasses import dataclass
+
+
+@dataclass
+class Coordinates:
+ x: int
+ y: int
+
+ def __add__(self, other: "Coordinates"):
+ """ Return the result of the addition of two Coordinates objects. """
+ return Coordinates(x=self.x + other.x, y = self.y + other.y)