aboutsummaryrefslogtreecommitdiff
path: root/src/bootstrap.cpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-04-24 17:13:52 +0200
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:58 +0200
commitdb6edcd473a684420e9a7611b24462df21165c1b (patch)
tree9646bdb4f5f6e339a0a01873b44e0b185476ce56 /src/bootstrap.cpp
parentb36d072ad7a7b9c6e30fcb25d6bbb001a8393468 (diff)
style: improve function and brace styling
Diffstat (limited to 'src/bootstrap.cpp')
-rw-r--r--src/bootstrap.cpp45
1 files changed, 31 insertions, 14 deletions
diff --git a/src/bootstrap.cpp b/src/bootstrap.cpp
index 22fe472..f36bc6a 100644
--- a/src/bootstrap.cpp
+++ b/src/bootstrap.cpp
@@ -49,9 +49,11 @@ auto bootstrap() noexcept -> Container
container.bind<ISeedGenerator>().to<SeedGenerator>();
container.bind<IGameFactory>().to_factory(
- [&container](const std::shared_ptr<IWindow> &window,
- const std::shared_ptr<IScene> &scene,
- const std::shared_ptr<ICursorController> &cursor_controller)
+ [&container](
+ const std::shared_ptr<IWindow> &window,
+ const std::shared_ptr<IScene> &scene,
+ const std::shared_ptr<ICursorController> &cursor_controller
+ )
{
std::shared_ptr<IStatusLine> statusline =
container.get<IStatusLineFactory>()(cursor_controller, window);
@@ -62,50 +64,65 @@ auto bootstrap() noexcept -> Container
std::shared_ptr<IStatusUpdater> status_updater =
container.get<IStatusUpdaterFactory>()(statusline, generation_tracker);
- return std::make_unique<Game>(window, scene, cursor_controller, statusline,
- generation_tracker, status_updater);
- });
+ return std::make_unique<Game>(
+ window,
+ scene,
+ cursor_controller,
+ statusline,
+ generation_tracker,
+ status_updater
+ );
+ }
+ );
container.bind<IRandomNumberGeneratorFactory>().to_factory(
[](const uint32_t &seed)
{
return std::make_unique<RandomNumberGenerator>(seed);
- });
+ }
+ );
container.bind<IMatrixFactory<std::string_view>>().to_factory(
[](const Bounds &bounds)
{
return std::make_unique<Matrix<std::string_view>>(bounds);
- });
+ }
+ );
container.bind<ISceneFactory>().to_factory(
- [&container](const std::shared_ptr<ICursorController> &cursor_controller,
- const std::shared_ptr<IWindow> &window)
+ [&container](
+ const std::shared_ptr<ICursorController> &cursor_controller,
+ const std::shared_ptr<IWindow> &window
+ )
{
auto matrix_factory = container.get<IMatrixFactory<std::string_view>>();
return std::make_unique<Scene>(matrix_factory, cursor_controller, window);
- });
+ }
+ );
container.bind<IStatusLineFactory>().to_factory(
[](const std::shared_ptr<ICursorController> &cursor_controller,
const std::shared_ptr<IWindow> &window)
{
return std::make_unique<StatusLine>(cursor_controller, window);
- });
+ }
+ );
container.bind<IStatusUpdaterFactory>().to_factory(
[](const std::shared_ptr<IStatusLine> &statusline,
const std::shared_ptr<IGenerationTracker> &generation_tracker)
{
return std::make_unique<StatusUpdater>(statusline, generation_tracker);
- });
+ }
+ );
container.bind<IGenerationTrackerFactory>().to_factory(
[](bool is_paused)
{
return std::make_unique<GenerationTracker>(is_paused);
- });
+ }
+ );
return container;
}