From 5dae8f8d10d506abc3c75a1f66c1dfe620c84fc1 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 15 Feb 2022 20:27:51 +0100 Subject: refactor: improve project design --- src/engine/bounds.hpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/engine/bounds.hpp (limited to 'src/engine/bounds.hpp') 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; +}; -- cgit v1.2.3-18-g5258