diff options
Diffstat (limited to 'engine')
-rw-r--r-- | engine/include/kurator/engine/Point.h | 2 | ||||
-rw-r--r-- | engine/src/Point.cpp | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/engine/include/kurator/engine/Point.h b/engine/include/kurator/engine/Point.h index 3dc0c8b..4b352d6 100644 --- a/engine/include/kurator/engine/Point.h +++ b/engine/include/kurator/engine/Point.h @@ -21,6 +21,8 @@ struct Point Point operator+(const Point& other) const; Point subtract(const Point& other) const; Point subtract(double _x, double _y) const; + bool operator==(const Point& other) const; + bool operator!=(const Point& other) const; }; diff --git a/engine/src/Point.cpp b/engine/src/Point.cpp index f02991c..e01de57 100644 --- a/engine/src/Point.cpp +++ b/engine/src/Point.cpp @@ -82,5 +82,19 @@ Point::subtract(const double _x, const double _y) const } +bool +Point::operator==(const Point& other) const +{ + return x == other.x && y == other.y; +} + + +bool +Point::operator!=(const Point& other) const +{ + return x != other.x || y != other.y; +} + + } // namespace engine } // namespace kurator |