aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/engine/data/vector2.cpp36
-rw-r--r--src/engine/data/vector2.hpp12
2 files changed, 24 insertions, 24 deletions
diff --git a/src/engine/data/vector2.cpp b/src/engine/data/vector2.cpp
index ba155b5..b838051 100644
--- a/src/engine/data/vector2.cpp
+++ b/src/engine/data/vector2.cpp
@@ -28,55 +28,55 @@ Vector2 Vector2::to_direction(const Vector2 &direction,
return *this + (direction * Vector2({.x = amount, .y = amount}));
}
-const Vector2 &Vector2::operator+=(const Vector2 &vector2) noexcept
+const Vector2 &Vector2::operator+=(const Vector2 &rhs) noexcept
{
- _x += vector2._x;
- _y += vector2._y;
+ _x += rhs._x;
+ _y += rhs._y;
return *this;
}
-const Vector2 &Vector2::operator-=(const Vector2 &vector2) noexcept
+const Vector2 &Vector2::operator-=(const Vector2 &rhs) noexcept
{
- _x -= vector2._x;
- _y -= vector2._y;
+ _x -= rhs._x;
+ _y -= rhs._y;
return *this;
}
-Vector2 Vector2::operator+(const Vector2 &vector2) const noexcept
+Vector2 Vector2::operator+(const Vector2 &rhs) const noexcept
{
auto new_vector2 = Vector2(*this);
- new_vector2._x += vector2._x;
- new_vector2._y += vector2._y;
+ new_vector2._x += rhs._x;
+ new_vector2._y += rhs._y;
return new_vector2;
}
-Vector2 Vector2::operator-(const Vector2 &vector2) const noexcept
+Vector2 Vector2::operator-(const Vector2 &rhs) const noexcept
{
auto new_vector2 = Vector2(*this);
- new_vector2._x -= vector2._x;
- new_vector2._y -= vector2._y;
+ new_vector2._x -= rhs._x;
+ new_vector2._y -= rhs._y;
return new_vector2;
}
-Vector2 Vector2::operator*(const Vector2 &vector2) const noexcept
+Vector2 Vector2::operator*(const Vector2 &rhs) const noexcept
{
- auto new_vector2 = Vector2(*this);
+ auto new_vector2 = *this;
- new_vector2._x *= vector2._x;
- new_vector2._y *= vector2._y;
+ new_vector2._x *= rhs._x;
+ new_vector2._y *= rhs._y;
return new_vector2;
}
-bool Vector2::operator==(const Vector2 &vector2) const noexcept
+bool Vector2::operator==(const Vector2 &rhs) const noexcept
{
- return _x == vector2._x && _y == vector2._y;
+ return _x == rhs._x && _y == rhs._y;
}
std::size_t Vector2Hasher::operator()(const Vector2 &vector2) const noexcept
diff --git a/src/engine/data/vector2.hpp b/src/engine/data/vector2.hpp
index 60cecf3..78eba11 100644
--- a/src/engine/data/vector2.hpp
+++ b/src/engine/data/vector2.hpp
@@ -33,14 +33,14 @@ public:
[[nodiscard]] Vector2 to_direction(const Vector2 &direction,
Vector2::Value amount) const noexcept;
- const Vector2 &operator+=(const Vector2 &vector2) noexcept;
- const Vector2 &operator-=(const Vector2 &vector2) noexcept;
+ const Vector2 &operator+=(const Vector2 &rhs) noexcept;
+ const Vector2 &operator-=(const Vector2 &rhs) noexcept;
- Vector2 operator+(const Vector2 &vector2) const noexcept;
- Vector2 operator-(const Vector2 &vector2) const noexcept;
- Vector2 operator*(const Vector2 &vector2) const noexcept;
+ Vector2 operator+(const Vector2 &rhs) const noexcept;
+ Vector2 operator-(const Vector2 &rhs) const noexcept;
+ Vector2 operator*(const Vector2 &rhs) const noexcept;
- bool operator==(const Vector2 &vector2) const noexcept;
+ bool operator==(const Vector2 &rhs) const noexcept;
/**
* Returns Vector2({.x = 0, .y = -1})