diff options
Diffstat (limited to 'src/interfaces')
-rw-r--r-- | src/interfaces/game.hpp | 8 | ||||
-rw-r--r-- | src/interfaces/scene.hpp | 9 | ||||
-rw-r--r-- | src/interfaces/statusline.hpp | 4 | ||||
-rw-r--r-- | src/interfaces/window.hpp | 12 |
4 files changed, 8 insertions, 25 deletions
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 <yacppdic/factory.hpp> @@ -26,13 +25,6 @@ public: -> std::unordered_map<char, std::shared_ptr<ICommand>> = 0; }; -/* -using IGameFactory = std::unique_ptr<IGame> (*)( - const std::shared_ptr<IWindow> &window, const std::shared_ptr<IScene> &scene, - const std::shared_ptr<ICursorController> &cursor_controller); - */ - using IGameFactory = yacppdic::Factory<std::unique_ptr<IGame>( - const std::shared_ptr<IWindow> &window, const std::shared_ptr<IScene> &scene, const std::shared_ptr<ICursorController> &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 <yacppdic/factory.hpp> #include <memory> +#include <string_view> // 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<IMatrix<std::string_view>> & = 0; }; using ISceneFactory = yacppdic::Factory<std::unique_ptr<IScene>( - const std::shared_ptr<ICursorController> &cursor_controller, - const std::shared_ptr<IWindow> &window)>; + const std::shared_ptr<ICursorController> &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 <yacppdic/factory.hpp> @@ -36,4 +36,4 @@ public: using IStatusLineFactory = yacppdic::Factory<std::unique_ptr<IStatusLine>( const std::shared_ptr<ICursorController> &cursor_controller, - const std::shared_ptr<IWindow> &window)>; + const std::shared_ptr<IScene> &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; -}; |