aboutsummaryrefslogtreecommitdiff
path: root/src/engine/graphics/component_renderer.hpp
blob: 4d21623d8849d1c9d7187bfea44e39c34bd8a3e2 (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
#pragma once

#include <memory>

#include "engine/data/vector2.hpp"
#include "interfaces/component.hpp"
#include "interfaces/component_renderer.hpp"
#include "interfaces/cursor.hpp"

class IComponent;
class ICursorController;
class Vector2;

constexpr auto SET_BOLD_MODE = "{esc}[1m";

class ComponentRenderer : public IComponentRenderer
{
public:
	explicit ComponentRenderer(
		std::shared_ptr<ICursorController> cursor_controller) noexcept;

	void render(
		const std::shared_ptr<IComponent> &component,
		const Vector2 &position) noexcept override;

private:
	std::shared_ptr<ICursorController> _cursor_controller;

	static void
	_use_component_colors(const std::shared_ptr<IComponent> &component) noexcept;
};