diff options
Diffstat (limited to 'src/engine/data/bounds.hpp')
-rw-r--r-- | src/engine/data/bounds.hpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/engine/data/bounds.hpp b/src/engine/data/bounds.hpp new file mode 100644 index 0000000..1875bf4 --- /dev/null +++ b/src/engine/data/bounds.hpp @@ -0,0 +1,42 @@ +#pragma once + +#include "engine/data/vector2.hpp" + +#include <cstdint> + +enum CoordsValidation +{ + VALID, + X_HIGH, + Y_HIGH +}; + +struct BoundsOptions +{ + uint32_t width; + uint32_t height; +}; + +class Bounds +{ +public: + explicit Bounds(const BoundsOptions &options); + + [[nodiscard]] uint32_t width() const noexcept; + + void width(uint32_t width) noexcept; + + [[nodiscard]] uint32_t height() const noexcept; + + void height(uint32_t height) noexcept; + + [[nodiscard]] CoordsValidation validate_coords(const Vector2 &coords) const noexcept; + + const Bounds &operator*=(const Bounds &bounds) noexcept; + const Bounds &operator+=(const Bounds &bounds) noexcept; + const Bounds &operator-=(const Bounds &bounds) noexcept; + +private: + uint32_t _width = 0U; + uint32_t _height = 0U; +}; |