aboutsummaryrefslogtreecommitdiff
path: root/src/bootstrap.cpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-10 19:12:31 +0100
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:55 +0200
commit38f14606c78c119d452f302f17329455e29a9a6f (patch)
tree03f6dfd9d3576e87260f7cb3bc436ad076b629c5 /src/bootstrap.cpp
parent09848ad31af6a1c70d64fccee711e231afb5a77f (diff)
refactor: rename game initializer & move input config
Diffstat (limited to 'src/bootstrap.cpp')
-rw-r--r--src/bootstrap.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/bootstrap.cpp b/src/bootstrap.cpp
index 2e64986..8aeba85 100644
--- a/src/bootstrap.cpp
+++ b/src/bootstrap.cpp
@@ -3,25 +3,25 @@
// Interfaces
#include "interfaces/argument_parser.hpp"
#include "interfaces/cursor.hpp"
+#include "interfaces/engine.hpp"
#include "interfaces/game.hpp"
-#include "interfaces/game_initializer.hpp"
#include "interfaces/input.hpp"
-#include "interfaces/input_configurator.hpp"
#include "interfaces/matrix.hpp"
#include "interfaces/randomization.hpp"
#include "interfaces/scene.hpp"
+#include "interfaces/window.hpp"
// Implementations
#include "argument_parser.hpp"
#include "engine/data/bounds.hpp"
#include "engine/data/vector2.hpp"
-#include "engine/game_initializer.hpp"
+#include "engine/engine.hpp"
#include "engine/graphics/scene.hpp"
#include "engine/graphics/string_matrix.hpp"
+#include "engine/graphics/window.hpp"
#include "engine/user/cursor.hpp"
#include "engine/user/input.hpp"
#include "game/game.hpp"
-#include "game/input_configurator.hpp"
#include "randomization/generator.hpp"
#include "randomization/seed_generator.hpp"
@@ -37,11 +37,10 @@ Container bootstrap()
container.bind<IArgumentParser>().to<ArgumentParser>();
container.bind<IGame>().to<Game>();
- container.bind<IScene>().to<Scene>();
container.bind<IInputHandler>().to<InputHandler>();
container.bind<ICursorController>().to<CursorController>();
- container.bind<IGameInitializer>().to<GameInitializer>();
- container.bind<IInputConfigurator>().to<InputConfigurator>();
+ container.bind<ICLIGameEngine>().to<CLIGameEngine>();
+ container.bind<IWindow>().to<Window>();
container.bind<IGameFactory>().to_factory(normalize_lambda(
[&container]()
@@ -70,5 +69,12 @@ Container bootstrap()
std::make_shared<StringMatrix>(bounds));
});
+ container.bind<ISceneFactory>().to_factory(normalize_lambda(
+ [&container]()
+ {
+ return std::dynamic_pointer_cast<IScene>(std::make_shared<Scene>(
+ container.get<IMatrixFactory<std::string_view>>()));
+ }));
+
return container;
}