diff options
author | HampusM <hampus@hampusmat.com> | 2022-06-07 19:45:17 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:57:01 +0200 |
commit | 8805b1fe27344e8086cebabf869b7a02d2376f05 (patch) | |
tree | a90a2e2dda1bcb98fb4de5cd983138e5441c2222 /src/engine/graphics/statusline.hpp | |
parent | f778317bae709f397345a2d5e04e23864c6391b3 (diff) |
refactor: decouple statusline from scene & cursor controller
Might be slightly slower than previously though...
Diffstat (limited to 'src/engine/graphics/statusline.hpp')
-rw-r--r-- | src/engine/graphics/statusline.hpp | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/src/engine/graphics/statusline.hpp b/src/engine/graphics/statusline.hpp deleted file mode 100644 index 6f0a4c2..0000000 --- a/src/engine/graphics/statusline.hpp +++ /dev/null @@ -1,48 +0,0 @@ -#pragma once - -#include "interfaces/cursor.hpp" -#include "interfaces/scene.hpp" -#include "interfaces/statusline.hpp" - -#include "engine/data/vector2.hpp" - -#include <fmt/core.h> - -#include <memory> -#include <string_view> -#include <unordered_map> - -constexpr uint32_t STATUSBAR_COLOR = 0x1A1A1AU; - -class StatusLine : public IStatusLine -{ -public: - StatusLine( - std::shared_ptr<ICursorController> cursor_controller, - std::shared_ptr<IScene> scene) noexcept; - - void initialize_background() noexcept override; - - void set_status( - const StatusLineSection §ion, - const std::string_view &status, - std::size_t start) noexcept override; - - void set_section_length(const StatusLineSection §ion, uint32_t length) noexcept - override; - -private: - std::unordered_map<StatusLineSection, uint32_t> _sections_lengths; - - std::shared_ptr<ICursorController> _cursor_controller; - std::shared_ptr<IScene> _scene; - - auto _move_to_statusline(int32_t x) noexcept -> Vector2; - - void _move_back(Vector2 previous_position) noexcept; - - [[nodiscard]] auto - _get_section_start_x(const StatusLineSection §ion) const noexcept -> int32_t; - - void _clear_section(const StatusLineSection §ion, std::size_t start) noexcept; -}; |