blob: 1875bf490d15efcd194848bcf503b88b2e6e78f9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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;
};
|