aboutsummaryrefslogtreecommitdiff
path: root/src/engine/bounds.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-02-15 20:27:51 +0100
committerHampusM <hampus@hampusmat.com>2022-02-15 20:27:51 +0100
commit5dae8f8d10d506abc3c75a1f66c1dfe620c84fc1 (patch)
tree2bfb6efef0535a35bab1da811a5f69cb5203dff9 /src/engine/bounds.hpp
parent9147551cd21d565f9503e3ebbcd2121e284d88d5 (diff)
refactor: improve project design
Diffstat (limited to 'src/engine/bounds.hpp')
-rw-r--r--src/engine/bounds.hpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/engine/bounds.hpp b/src/engine/bounds.hpp
new file mode 100644
index 0000000..964e73a
--- /dev/null
+++ b/src/engine/bounds.hpp
@@ -0,0 +1,32 @@
+#pragma once
+
+#include "engine/vector2.hpp"
+
+struct BoundsOpts
+{
+ unsigned int width;
+ unsigned int height;
+};
+
+class Bounds
+{
+public:
+ explicit Bounds(BoundsOpts opts);
+
+ [[nodiscard]] unsigned int width() const;
+
+ void width(unsigned int width);
+
+ [[nodiscard]] unsigned int height() const;
+
+ void height(unsigned int height);
+
+ void verify_coords(const Vector2 &coords) const;
+
+ Bounds operator*(const Bounds &bounds) const;
+ Bounds operator+(const Bounds &bounds) const;
+
+private:
+ unsigned int _width = 0U;
+ unsigned int _height = 0U;
+};