aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/component.hpp
blob: 2f62c9545e9500bff8b9f0f553bb0b78e897fc6f (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 -> uint32_t = 0;

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