aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/component.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-06-07 19:45:17 +0200
committerHampusM <hampus@hampusmat.com>2022-06-13 17:57:01 +0200
commit8805b1fe27344e8086cebabf869b7a02d2376f05 (patch)
treea90a2e2dda1bcb98fb4de5cd983138e5441c2222 /src/interfaces/component.hpp
parentf778317bae709f397345a2d5e04e23864c6391b3 (diff)
refactor: decouple statusline from scene & cursor controller
Might be slightly slower than previously though...
Diffstat (limited to 'src/interfaces/component.hpp')
-rw-r--r--src/interfaces/component.hpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/interfaces/component.hpp b/src/interfaces/component.hpp
new file mode 100644
index 0000000..7e1b132
--- /dev/null
+++ b/src/interfaces/component.hpp
@@ -0,0 +1,25 @@
+#pragma once
+
+#include "interfaces/matrix.hpp"
+
+#include <memory>
+
+// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions)
+class IComponent
+{
+public:
+ using ComponentMatrix = IMatrix<char>;
+
+ 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;
+};