aboutsummaryrefslogtreecommitdiff
path: root/src/engine/data/vector2.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-10 19:12:31 +0100
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:55 +0200
commit38f14606c78c119d452f302f17329455e29a9a6f (patch)
tree03f6dfd9d3576e87260f7cb3bc436ad076b629c5 /src/engine/data/vector2.hpp
parent09848ad31af6a1c70d64fccee711e231afb5a77f (diff)
refactor: rename game initializer & move input config
Diffstat (limited to 'src/engine/data/vector2.hpp')
-rw-r--r--src/engine/data/vector2.hpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/engine/data/vector2.hpp b/src/engine/data/vector2.hpp
index 49e5d85..e835e65 100644
--- a/src/engine/data/vector2.hpp
+++ b/src/engine/data/vector2.hpp
@@ -27,18 +27,24 @@ public:
void set_y(Value y) noexcept;
+ [[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;
+ Vector2 operator+(const Vector2 &vector2) const noexcept;
+ Vector2 operator*(const Vector2 &vector2) const noexcept;
+
bool operator==(const Vector2 &vector2) const noexcept;
/**
- * Returns Vector2({.x = 0, .y = 1})
+ * Returns Vector2({.x = 0, .y = -1})
*/
static Vector2 up() noexcept;
/**
- * Returns Vector2({.x = 0, .y = -1})
+ * Returns Vector2({.x = 0, .y = 1})
*/
static Vector2 down() noexcept;