aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/component_renderer.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/component_renderer.hpp')
-rw-r--r--src/interfaces/component_renderer.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/interfaces/component_renderer.hpp b/src/interfaces/component_renderer.hpp
new file mode 100644
index 0000000..fa8bc18
--- /dev/null
+++ b/src/interfaces/component_renderer.hpp
@@ -0,0 +1,24 @@
+#pragma once
+
+#include "interfaces/component.hpp"
+#include "interfaces/cursor.hpp"
+
+#include "engine/data/vector2.hpp"
+
+#include <yacppdic/factory.hpp>
+
+#include <memory>
+
+// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions)
+class IComponentRenderer
+{
+public:
+ virtual ~IComponentRenderer() = default;
+
+ virtual void render(
+ const std::shared_ptr<IComponent> &component,
+ const Vector2 &position) noexcept = 0;
+};
+
+using IComponentRendererFactory = yacppdic::Factory<std::unique_ptr<IComponentRenderer>(
+ const std::shared_ptr<ICursorController> &)>;