#pragma once #include #include #include #include #include #include #include "engine/data/bounds.hpp" #include "engine/data/vector2.hpp" #include "engine/io/terminal.hpp" #include "interfaces/component.hpp" #include "interfaces/matrix.hpp" #include "interfaces/scene.hpp" class IComponent; struct termios; constexpr fmt::string_view ENABLE_ALT_BUFFER = "{esc}[?1049h"; constexpr fmt::string_view DISABLE_ALT_BUFFER = "{esc}[?1049l"; class Scene : public IScene, public yacppdic::AutoWirable> { public: explicit Scene(const IMatrixFactory &matrix_factory) noexcept; void enter() noexcept override; void leave() noexcept override; [[nodiscard]] auto size() const noexcept -> Bounds override; [[nodiscard]] auto get_matrix() const noexcept -> const std::shared_ptr> & override; void register_component( const std::shared_ptr &component, const Vector2 &position) noexcept override; [[nodiscard]] auto get_components() const noexcept -> std::vector, Vector2>> override; private: std::shared_ptr> _matrix; bool _is_shown; TerminalState _original_terminal_state{}; std::vector, Vector2>> _components; };