aboutsummaryrefslogtreecommitdiff
path: root/src/engine/graphics
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-06-08 16:21:40 +0200
committerHampusM <hampus@hampusmat.com>2022-06-13 17:57:01 +0200
commitdcc6d3d5cafe47d53d1b321476bf73bb2d65ae9b (patch)
tree8fabd71b3f71d82a63694031dda1a89c49fb4f15 /src/engine/graphics
parent3f9004b598fc8006576db9b8d2ae4e080101101b (diff)
refactor: remove unused cursor controller dependency from scene
Diffstat (limited to 'src/engine/graphics')
-rw-r--r--src/engine/graphics/scene.cpp8
-rw-r--r--src/engine/graphics/scene.hpp11
2 files changed, 7 insertions, 12 deletions
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 <iostream>
#include <sys/ioctl.h>
-Scene::Scene(
- IMatrixFactory<MatrixElement> matrix_factory,
- std::shared_ptr<ICursorController> cursor_controller) noexcept
- : _matrix(matrix_factory(size())),
- _cursor_controller(std::move(cursor_controller)),
- _is_shown(false)
+Scene::Scene(const IMatrixFactory<MatrixElement> &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 <fmt/core.h>
+#include <yacppdic/auto_wirable.hpp>
#include <memory>
#include <string_view>
@@ -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<IScene, Scene, IMatrixFactory<IScene::MatrixElement>>
{
public:
- explicit Scene(
- IMatrixFactory<MatrixElement> matrix_factory,
- std::shared_ptr<ICursorController> cursor_controller) noexcept;
+ explicit Scene(const IMatrixFactory<MatrixElement> &matrix_factory) noexcept;
void enter() noexcept override;
@@ -43,7 +43,6 @@ public:
private:
std::shared_ptr<IMatrix<MatrixElement>> _matrix;
- std::shared_ptr<ICursorController> _cursor_controller;
bool _is_shown;
std::shared_ptr<termios> _original_termios = nullptr;