From 8805b1fe27344e8086cebabf869b7a02d2376f05 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 7 Jun 2022 19:45:17 +0200 Subject: refactor: decouple statusline from scene & cursor controller Might be slightly slower than previously though... --- src/interfaces/component.hpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/interfaces/component.hpp (limited to 'src/interfaces/component.hpp') 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 + +// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) +class IComponent +{ +public: + using ComponentMatrix = IMatrix; + + virtual ~IComponent() = default; + + [[nodiscard]] virtual auto get() const noexcept + -> const std::shared_ptr & = 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; +}; -- cgit v1.2.3-18-g5258