aboutsummaryrefslogtreecommitdiff
path: root/src/engine/data/vector2.cpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-19 13:28:29 +0100
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:56 +0200
commit3dbf3b68c484704aafcda9fd05ae88a0337956ef (patch)
treeb7a2d45811c0ed5e336f87c23369f3929322b0cc /src/engine/data/vector2.cpp
parent55c93fe609888be73677317978959040cf35b2ff (diff)
feat: add inserting cells
Diffstat (limited to 'src/engine/data/vector2.cpp')
-rw-r--r--src/engine/data/vector2.cpp10
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);