aboutsummaryrefslogtreecommitdiff
path: root/src/bootstrap.cpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-08 16:26:17 +0100
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:55 +0200
commit9dd5936333082305b0b9680db2eac9abd128129b (patch)
treec99bff09a066bde806a520058347b549ed287a9f /src/bootstrap.cpp
parent3a24ec6e5b5236ad6b943548b9948603e053559d (diff)
refactor: add game factory
Diffstat (limited to 'src/bootstrap.cpp')
-rw-r--r--src/bootstrap.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/bootstrap.cpp b/src/bootstrap.cpp
index ddeba4d..610945f 100644
--- a/src/bootstrap.cpp
+++ b/src/bootstrap.cpp
@@ -24,6 +24,8 @@
#include "randomization/generator.hpp"
#include "randomization/seed_generator.hpp"
+#include "util/function.hpp"
+
#include <memory>
#include <random>
#include <string_view>
@@ -40,6 +42,12 @@ Container bootstrap()
container.bind<IGameInitializer>().to<GameInitializer>();
container.bind<IInputConfigurator>().to<InputConfigurator>();
+ container.bind<IGameFactory>().to_factory(normalize_lambda(
+ [&container]()
+ {
+ return container.get<IGame>();
+ }));
+
container.bind<IRandomNumberGeneratorFactory>().to_factory(
[](const uint32_t &seed)
{