aboutsummaryrefslogtreecommitdiff
path: root/XY.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-24 14:44:20 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-24 14:44:20 +0200
commitafc66d3013b7d47c6c22d6a99809bc3e7d1ff0dc (patch)
treede50baa5d2f87cc8a416cbd321f7c7f430b03613 /XY.cpp
parent1e0a52b03fe655d7073ef20703dbb2e7646f74d3 (diff)
implement breadth-first search pathfinding
Diffstat (limited to 'XY.cpp')
-rw-r--r--XY.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/XY.cpp b/XY.cpp
index ad1262b..e2aa075 100644
--- a/XY.cpp
+++ b/XY.cpp
@@ -33,3 +33,13 @@ XY& XY::operator -= (const XY & rhs) {
return *this;
}
+bool XY::operator == (const XY& rhs) const {
+ if (this->x != rhs.x) return false;
+ if (this->y != rhs.y) return false;
+ return true;
+}
+
+bool XY::operator != (const XY& rhs) const {
+ return !(*this == rhs);
+}
+