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/scene.cpp | |
parent | f778317bae709f397345a2d5e04e23864c6391b3 (diff) |
refactor: decouple statusline from scene & cursor controller
Might be slightly slower than previously though...
Diffstat (limited to 'src/engine/graphics/scene.cpp')
-rw-r--r-- | src/engine/graphics/scene.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/engine/graphics/scene.cpp b/src/engine/graphics/scene.cpp index 9f561f0..e0f4da6 100644 --- a/src/engine/graphics/scene.cpp +++ b/src/engine/graphics/scene.cpp @@ -8,7 +8,6 @@ #include <iostream> #include <sys/ioctl.h> -#include <utility> Scene::Scene( IMatrixFactory<MatrixElement> matrix_factory, @@ -84,3 +83,17 @@ auto Scene::get_matrix() const noexcept -> const std::shared_ptr<IMatrix<MatrixE { return _matrix; } + +void Scene::register_component( + const std::shared_ptr<IComponent> &component, + const Vector2 &position) noexcept +{ + _components.emplace_back(std::make_pair(component, position)); +} + +auto Scene::get_components() const noexcept + -> std::vector<std::pair<std::shared_ptr<IComponent>, Vector2>> +{ + return _components; +} + |