diff --git a/Source/engine.h b/Source/engine.h index e39dfb5a8..33afa7ecc 100644 --- a/Source/engine.h +++ b/Source/engine.h @@ -60,6 +60,32 @@ enum direction : uint8_t { struct Point { int x; int y; + + Point &operator +=(const Point &other) + { + x += other.x; + y += other.y; + return *this; + } + + Point &operator -=(const Point &other) + { + x -= other.x; + y -= other.y; + return *this; + } + + friend Point operator +(Point a, const Point &b) + { + a += b; + return a; + } + + friend Point operator -(Point a, const Point &b) + { + a -= b; + return a; + } }; struct ActorPosition {