diff options
author | HampusM <hampus@hampusmat.com> | 2022-03-06 13:26:14 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:54 +0200 |
commit | a285df324deb579d262ea7cf484de4d6b11b28e4 (patch) | |
tree | e2d181d58a09826c318d7aab5bee66bad3cf484a /src/engine/data/vector2.hpp | |
parent | 0e40bc7ce8c3b3be083002f88c3317d65f6570ad (diff) |
refactor: improve getters & setters for vector2 & bounds
Diffstat (limited to 'src/engine/data/vector2.hpp')
-rw-r--r-- | src/engine/data/vector2.hpp | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/src/engine/data/vector2.hpp b/src/engine/data/vector2.hpp index 580123c..a7896ef 100644 --- a/src/engine/data/vector2.hpp +++ b/src/engine/data/vector2.hpp @@ -14,34 +14,15 @@ struct Vector2Options class Vector2 { public: - /** - * Creates a 2D vector. - */ explicit Vector2(const Vector2Options &options); - /** - * Returns the X coordinate. - */ - [[nodiscard]] uint32_t x() const noexcept; - - /** - * Sets the X coordinate. - * - * @param x A new X coordinate - */ - void x(uint32_t x) noexcept; - - /** - * Returns the Y coordinate. - */ - [[nodiscard]] uint32_t y() const noexcept; - - /** - * Sets the Y coordinate. - * - * @param Y A new Y coordinate - */ - void y(uint32_t y) noexcept; + [[nodiscard]] uint32_t get_x() const noexcept; + + void set_x(uint32_t x) noexcept; + + [[nodiscard]] uint32_t get_y() const noexcept; + + void set_y(uint32_t y) noexcept; const Vector2 &operator+=(const Vector2 &vector2) noexcept; const Vector2 &operator-=(const Vector2 &vector2) noexcept; |