From dcc6d3d5cafe47d53d1b321476bf73bb2d65ae9b Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 8 Jun 2022 16:21:40 +0200 Subject: refactor: remove unused cursor controller dependency from scene --- src/engine/graphics/scene.cpp | 8 ++------ src/engine/graphics/scene.hpp | 11 +++++------ 2 files changed, 7 insertions(+), 12 deletions(-) (limited to 'src/engine/graphics') diff --git a/src/engine/graphics/scene.cpp b/src/engine/graphics/scene.cpp index e0f4da6..e4bdb6e 100644 --- a/src/engine/graphics/scene.cpp +++ b/src/engine/graphics/scene.cpp @@ -9,12 +9,8 @@ #include #include -Scene::Scene( - IMatrixFactory matrix_factory, - std::shared_ptr cursor_controller) noexcept - : _matrix(matrix_factory(size())), - _cursor_controller(std::move(cursor_controller)), - _is_shown(false) +Scene::Scene(const IMatrixFactory &matrix_factory) noexcept + : _matrix(matrix_factory(size())), _is_shown(false) { _matrix->fill(' '); } diff --git a/src/engine/graphics/scene.hpp b/src/engine/graphics/scene.hpp index c2b11e8..4df5f56 100644 --- a/src/engine/graphics/scene.hpp +++ b/src/engine/graphics/scene.hpp @@ -1,13 +1,13 @@ #pragma once #include "interfaces/component.hpp" -#include "interfaces/cursor.hpp" #include "interfaces/matrix.hpp" #include "interfaces/scene.hpp" #include "engine/data/vector2.hpp" #include +#include #include #include @@ -18,12 +18,12 @@ constexpr fmt::string_view ENABLE_ALT_BUFFER = "{esc}[?1049h"; constexpr fmt::string_view DISABLE_ALT_BUFFER = "{esc}[?1049l"; -class Scene : public IScene +class Scene + : public IScene, + public yacppdic::AutoWirable> { public: - explicit Scene( - IMatrixFactory matrix_factory, - std::shared_ptr cursor_controller) noexcept; + explicit Scene(const IMatrixFactory &matrix_factory) noexcept; void enter() noexcept override; @@ -43,7 +43,6 @@ public: private: std::shared_ptr> _matrix; - std::shared_ptr _cursor_controller; bool _is_shown; std::shared_ptr _original_termios = nullptr; -- cgit v1.2.3-18-g5258