From afc66d3013b7d47c6c22d6a99809bc3e7d1ff0dc Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Thu, 24 Oct 2024 14:44:20 +0200 Subject: implement breadth-first search pathfinding --- XY.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'XY.cpp') 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); +} + -- cgit v1.2.3