diff options
Diffstat (limited to 'src/interfaces')
-rw-r--r-- | src/interfaces/cursor.hpp | 10 | ||||
-rw-r--r-- | src/interfaces/engine.hpp | 11 | ||||
-rw-r--r-- | src/interfaces/game.hpp | 2 | ||||
-rw-r--r-- | src/interfaces/game_initializer.hpp | 9 | ||||
-rw-r--r-- | src/interfaces/input_configurator.hpp | 9 | ||||
-rw-r--r-- | src/interfaces/scene.hpp | 5 | ||||
-rw-r--r-- | src/interfaces/window.hpp | 9 |
7 files changed, 33 insertions, 22 deletions
diff --git a/src/interfaces/cursor.hpp b/src/interfaces/cursor.hpp index adab524..77c5096 100644 --- a/src/interfaces/cursor.hpp +++ b/src/interfaces/cursor.hpp @@ -2,16 +2,22 @@ #include "engine/data/vector2.hpp" +#include <memory> + class ICursorController { public: + virtual ~ICursorController() noexcept = default; + virtual void move(const Vector2 &direction, const uint32_t &amount) noexcept = 0; virtual void move_to(const Vector2 &position) noexcept = 0; [[nodiscard]] virtual Vector2 where() const noexcept = 0; - static void hide(); + virtual void ensure_position() noexcept = 0; + + static void hide() noexcept; - static void show(); + static void show() noexcept; }; diff --git a/src/interfaces/engine.hpp b/src/interfaces/engine.hpp new file mode 100644 index 0000000..498ff41 --- /dev/null +++ b/src/interfaces/engine.hpp @@ -0,0 +1,11 @@ +#pragma once + +#include "interfaces/observable.hpp" + +#include <unordered_map> + +class ICLIGameEngine +{ +public: + virtual void start() noexcept = 0; +}; diff --git a/src/interfaces/game.hpp b/src/interfaces/game.hpp index 85c20e5..338a8a3 100644 --- a/src/interfaces/game.hpp +++ b/src/interfaces/game.hpp @@ -10,7 +10,7 @@ class IGame public: virtual ~IGame() = default; - virtual void run(IScene &scene, IInputHandler &input_handler) = 0; + virtual void run() = 0; }; using IGameFactory = std::shared_ptr<IGame> (*)(); diff --git a/src/interfaces/game_initializer.hpp b/src/interfaces/game_initializer.hpp deleted file mode 100644 index 5dea2e9..0000000 --- a/src/interfaces/game_initializer.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include "interfaces/game.hpp" - -class IGameInitializer -{ -public: - virtual void initialize() = 0; -}; diff --git a/src/interfaces/input_configurator.hpp b/src/interfaces/input_configurator.hpp deleted file mode 100644 index 2bfe51e..0000000 --- a/src/interfaces/input_configurator.hpp +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include "interfaces/input.hpp" - -class IInputConfigurator -{ -public: - virtual void configure(IInputHandler &input_handler) = 0; -}; diff --git a/src/interfaces/scene.hpp b/src/interfaces/scene.hpp index 39110a2..ca494cb 100644 --- a/src/interfaces/scene.hpp +++ b/src/interfaces/scene.hpp @@ -1,8 +1,9 @@ #pragma once +#include "interfaces/cursor.hpp" #include "interfaces/matrix.hpp" +#include "interfaces/window.hpp" -#include <functional> #include <memory> #include <string_view> @@ -15,3 +16,5 @@ public: virtual void leave() = 0; }; + +using ISceneFactory = std::shared_ptr<IScene> (*)(); diff --git a/src/interfaces/window.hpp b/src/interfaces/window.hpp new file mode 100644 index 0000000..5da9aff --- /dev/null +++ b/src/interfaces/window.hpp @@ -0,0 +1,9 @@ +#pragma once + +#include "engine/data/bounds.hpp" + +class IWindow +{ +public: + [[nodiscard]] virtual Bounds size() const noexcept = 0; +}; |