diff options
author | HampusM <hampus@hampusmat.com> | 2022-04-10 17:20:49 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:58 +0200 |
commit | b36d072ad7a7b9c6e30fcb25d6bbb001a8393468 (patch) | |
tree | 7749fc877652bb2cf7bbd2b7c1fed5e3abe397fc /src/interfaces/game.hpp | |
parent | b828d4799a84beb1afbd889e5c4cb939a8b3df78 (diff) |
refactor: add factory class & make DI container return unique ptrs
Diffstat (limited to 'src/interfaces/game.hpp')
-rw-r--r-- | src/interfaces/game.hpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/interfaces/game.hpp b/src/interfaces/game.hpp index 46d79e4..0f5c895 100644 --- a/src/interfaces/game.hpp +++ b/src/interfaces/game.hpp @@ -5,6 +5,8 @@ #include "interfaces/scene.hpp" #include "interfaces/window.hpp" +#include "DI/factory.hpp" + #include <memory> #include <unordered_map> @@ -24,6 +26,12 @@ public: -> std::unordered_map<char, std::shared_ptr<ICommand>> = 0; }; -using IGameFactory = std::shared_ptr<IGame> (*)( +/* +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 = Factory<std::unique_ptr<IGame>( + const std::shared_ptr<IWindow> &window, const std::shared_ptr<IScene> &scene, + const std::shared_ptr<ICursorController> &cursor_controller)>; |