blob: e0a92bf16b2ea15052a488b61322d861c1d5cd33 (
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
43
44
45
46
47
48
|
#pragma once
#include "engine/data/bounds.hpp"
#include "engine/data/vector2.hpp"
#include <memory>
template <typename Element>
class IMatrix
{
public:
virtual ~IMatrix() = default;
/**
* Fills the matrix with a element.
*
* @param element A element
*/
virtual void fill(Element element) = 0;
/**
* Returns a element of the matrix.
*
* @param pos The position of a element
*/
[[nodiscard]] virtual Element get(const Vector2 &pos) const = 0;
/**
* Sets a element of the matrix.
*
* @param pos The position of a element
* @param element A new element
*/
virtual void set(const Vector2 &pos, Element element) = 0;
/**
* Returns the number of rows the matrix has.
*/
[[nodiscard]] virtual uint32_t rows() const = 0;
/**
* Returns the number of columns the matrix has.
*/
[[nodiscard]] virtual uint32_t columns() const = 0;
};
template <typename Element>
using IMatrixFactory = std::shared_ptr<IMatrix<Element>> (*)(const Bounds &bounds);
|