aboutsummaryrefslogtreecommitdiff
path: root/src/engine/data/bounds.hpp
blob: b29005e396e52cefd583dbe6aff2a2d3a72ec730 (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 get_width() const noexcept;

	void set_width(uint32_t width) noexcept;

	[[nodiscard]] uint32_t get_height() const noexcept;

	void set_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;
};