aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-05-22 17:05:00 +0200
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:59 +0200
commit7de921836587cdc359c2c4b84ed6446ada16c008 (patch)
treec4ec20b4769817c41ce7d939956da297bf787597 /src/interfaces
parent723ea6535b4c4e5605e5592137a898d6ffa458c1 (diff)
refactor: remove window class
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/game.hpp8
-rw-r--r--src/interfaces/scene.hpp9
-rw-r--r--src/interfaces/statusline.hpp4
-rw-r--r--src/interfaces/window.hpp12
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;
-};