aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/component.hpp
blob: bf0680a9a9ae1a14780f89cfb7fb73a17bd8e244 (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
#pragma once

#include "interfaces/matrix.hpp"

#include "engine/data/style.hpp"

#include <memory>
#include <optional>

class ComponentElement
{
public:
	char value{};
	Style style{};
};

// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions)
class IComponent
{
public:
	using ComponentMatrix = IMatrix<ComponentElement>;

	virtual ~IComponent() = default;

	[[nodiscard]] virtual auto get() const noexcept
		-> const std::shared_ptr<ComponentMatrix> & = 0;

	[[nodiscard]] virtual auto get_need_render() const noexcept -> bool = 0;

	virtual void set_need_render(bool need_render) noexcept = 0;

	[[nodiscard]] virtual auto get_foreground_color() const noexcept -> std::uint32_t = 0;

	[[nodiscard]] virtual auto get_background_color() const noexcept -> std::uint32_t = 0;
};