From 7de921836587cdc359c2c4b84ed6446ada16c008 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 22 May 2022 17:05:00 +0200 Subject: refactor: remove window class --- src/interfaces/game.hpp | 8 -------- src/interfaces/scene.hpp | 9 ++++++--- src/interfaces/statusline.hpp | 4 ++-- src/interfaces/window.hpp | 12 ------------ 4 files changed, 8 insertions(+), 25 deletions(-) delete mode 100644 src/interfaces/window.hpp (limited to 'src/interfaces') diff --git a/src/interfaces/game.hpp b/src/interfaces/game.hpp index e4df51c..a54782a 100644 --- a/src/interfaces/game.hpp +++ b/src/interfaces/game.hpp @@ -3,7 +3,6 @@ #include "interfaces/command.hpp" #include "interfaces/cursor.hpp" #include "interfaces/scene.hpp" -#include "interfaces/window.hpp" #include @@ -26,13 +25,6 @@ public: -> std::unordered_map> = 0; }; -/* -using IGameFactory = std::unique_ptr (*)( - const std::shared_ptr &window, const std::shared_ptr &scene, - const std::shared_ptr &cursor_controller); - */ - using IGameFactory = yacppdic::Factory( - const std::shared_ptr &window, const std::shared_ptr &scene, const std::shared_ptr &cursor_controller)>; diff --git a/src/interfaces/scene.hpp b/src/interfaces/scene.hpp index 01be07d..08615a9 100644 --- a/src/interfaces/scene.hpp +++ b/src/interfaces/scene.hpp @@ -2,11 +2,13 @@ #include "interfaces/cursor.hpp" #include "interfaces/matrix.hpp" -#include "interfaces/window.hpp" + +#include "engine/data/bounds.hpp" #include #include +#include // NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) class IScene @@ -18,10 +20,11 @@ public: virtual void leave() noexcept = 0; + [[nodiscard]] virtual auto size() const noexcept -> Bounds = 0; + [[nodiscard]] virtual auto get_matrix() const noexcept -> const std::shared_ptr> & = 0; }; using ISceneFactory = yacppdic::Factory( - const std::shared_ptr &cursor_controller, - const std::shared_ptr &window)>; + const std::shared_ptr &cursor_controller)>; diff --git a/src/interfaces/statusline.hpp b/src/interfaces/statusline.hpp index ca2a617..2e97ed6 100644 --- a/src/interfaces/statusline.hpp +++ b/src/interfaces/statusline.hpp @@ -1,7 +1,7 @@ #pragma once #include "interfaces/cursor.hpp" -#include "interfaces/window.hpp" +#include "interfaces/scene.hpp" #include @@ -36,4 +36,4 @@ public: using IStatusLineFactory = yacppdic::Factory( const std::shared_ptr &cursor_controller, - const std::shared_ptr &window)>; + const std::shared_ptr &scene)>; diff --git a/src/interfaces/window.hpp b/src/interfaces/window.hpp deleted file mode 100644 index 6fc56e9..0000000 --- a/src/interfaces/window.hpp +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -#include "engine/data/bounds.hpp" - -// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) -class IWindow -{ -public: - virtual ~IWindow() noexcept = default; - - [[nodiscard]] virtual auto size() const noexcept -> Bounds = 0; -}; -- cgit v1.2.3-18-g5258