blob: 8edad8074b9a976da19684d36c4f0f4b9ae77348 (
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
|
#pragma once
#include "engine/data/bounds.hpp"
#include "engine/data/vector2.hpp"
#include "engine/graphics/matrix_iterator.hpp"
#include <yacppdic/factory.hpp>
#include <memory>
template <typename ElementType>
// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions)
class IMatrix
{
public:
using Element = ElementType;
virtual ~IMatrix() noexcept = default;
virtual void fill(Element element) noexcept = 0;
[[nodiscard]] virtual auto get(const Vector2 &pos) const noexcept -> Element = 0;
virtual void set(const Vector2 &pos, Element element) noexcept = 0;
[[nodiscard]] virtual auto get_row_cnt() const noexcept -> std::uint32_t = 0;
[[nodiscard]] virtual auto get_column_cnt() const noexcept -> std::uint32_t = 0;
[[nodiscard]] virtual auto begin() const noexcept -> MatrixIterator<Element> = 0;
[[nodiscard]] virtual auto end() const noexcept -> MatrixIterator<Element> = 0;
};
template <typename Element>
using IMatrixFactory =
yacppdic::Factory<std::unique_ptr<IMatrix<Element>>(const Bounds &bounds)>;
|