aboutsummaryrefslogtreecommitdiff
path: root/src/engine/data/vector2.cpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-06 13:26:14 +0100
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:54 +0200
commita285df324deb579d262ea7cf484de4d6b11b28e4 (patch)
treee2d181d58a09826c318d7aab5bee66bad3cf484a /src/engine/data/vector2.cpp
parent0e40bc7ce8c3b3be083002f88c3317d65f6570ad (diff)
refactor: improve getters & setters for vector2 & bounds
Diffstat (limited to 'src/engine/data/vector2.cpp')
-rw-r--r--src/engine/data/vector2.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/engine/data/vector2.cpp b/src/engine/data/vector2.cpp
index 5d42913..7a22d62 100644
--- a/src/engine/data/vector2.cpp
+++ b/src/engine/data/vector2.cpp
@@ -2,38 +2,38 @@
Vector2::Vector2(const Vector2Options &options) : _x(options.x), _y(options.y) {}
-uint32_t Vector2::x() const noexcept
+uint32_t Vector2::get_x() const noexcept
{
return _x;
}
-void Vector2::x(uint32_t x) noexcept
+void Vector2::set_x(uint32_t x) noexcept
{
_x = x;
}
-uint32_t Vector2::y() const noexcept
+uint32_t Vector2::get_y() const noexcept
{
return _y;
}
-void Vector2::y(uint32_t y) noexcept
+void Vector2::set_y(uint32_t y) noexcept
{
_y = y;
}
const Vector2 &Vector2::operator+=(const Vector2 &vector2) noexcept
{
- _x += vector2.x();
- _y += vector2.y();
+ _x += vector2._x;
+ _y += vector2._y;
return *this;
}
const Vector2 &Vector2::operator-=(const Vector2 &vector2) noexcept
{
- _x -= vector2.x();
- _y -= vector2.y();
+ _x -= vector2._x;
+ _y -= vector2._y;
return *this;
}