diff options
Diffstat (limited to 'src/engine/data/vector2.cpp')
-rw-r--r-- | src/engine/data/vector2.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/engine/data/vector2.cpp b/src/engine/data/vector2.cpp index dba745f..ba155b5 100644 --- a/src/engine/data/vector2.cpp +++ b/src/engine/data/vector2.cpp @@ -54,6 +54,16 @@ Vector2 Vector2::operator+(const Vector2 &vector2) const noexcept return new_vector2; } +Vector2 Vector2::operator-(const Vector2 &vector2) const noexcept +{ + auto new_vector2 = Vector2(*this); + + new_vector2._x -= vector2._x; + new_vector2._y -= vector2._y; + + return new_vector2; +} + Vector2 Vector2::operator*(const Vector2 &vector2) const noexcept { auto new_vector2 = Vector2(*this); |