From 3dbf3b68c484704aafcda9fd05ae88a0337956ef Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 19 Mar 2022 13:28:29 +0100 Subject: feat: add inserting cells --- src/engine/graphics/scene.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/engine/graphics/scene.cpp') diff --git a/src/engine/graphics/scene.cpp b/src/engine/graphics/scene.cpp index 660e3ca..476b966 100644 --- a/src/engine/graphics/scene.cpp +++ b/src/engine/graphics/scene.cpp @@ -12,10 +12,11 @@ Scene::Scene(IMatrixFactory matrix_factory, std::shared_ptr cursor_controller, std::shared_ptr window) noexcept : _is_shown(false), - _matrix_factory(matrix_factory), + _matrix(matrix_factory(window->size() - Bounds({.width = 0U, .height = 1U}))), _cursor_controller(std::move(cursor_controller)), _window(std::move(window)) { + _matrix->fill(" "); } void Scene::enter() noexcept @@ -62,3 +63,8 @@ void Scene::write_status(const std::string_view &str) noexcept _cursor_controller->move_to(previous_position); } + +const std::shared_ptr> &Scene::get_matrix() const noexcept +{ + return _matrix; +} -- cgit v1.2.3-18-g5258