From db6edcd473a684420e9a7611b24462df21165c1b Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 24 Apr 2022 17:13:52 +0200 Subject: style: improve function and brace styling --- src/game/game.cpp | 56 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 18 deletions(-) (limited to 'src/game/game.cpp') diff --git a/src/game/game.cpp b/src/game/game.cpp index 88b9584..1a69e2e 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -9,11 +9,14 @@ #include #include -Game::Game(std::shared_ptr window, std::shared_ptr scene, - std::shared_ptr cursor_controller, - std::shared_ptr statusline, - std::shared_ptr generation_tracker, - std::shared_ptr status_updater) noexcept +Game::Game( + std::shared_ptr window, + std::shared_ptr scene, + std::shared_ptr cursor_controller, + std::shared_ptr statusline, + std::shared_ptr generation_tracker, + std::shared_ptr status_updater +) noexcept : _window(std::move(window)), _scene(std::move(scene)), _cursor_controller(std::move(cursor_controller)), @@ -32,8 +35,8 @@ void Game::on_start() noexcept const auto window_size = _window->size(); const auto center_position = - Vector2({.x = static_cast(window_size.get_width()) / 2, - .y = static_cast(window_size.get_height()) / 2}); + Vector2({ .x = static_cast(window_size.get_width()) / 2, + .y = static_cast(window_size.get_height()) / 2 }); _cursor_controller->move_to(center_position); @@ -60,15 +63,32 @@ void Game::on_exit() const noexcept auto Game::get_input_config() const noexcept -> std::unordered_map> { - return {{'q', std::make_shared()}, - {'i', std::make_shared(_cursor_controller, _scene)}, - {'p', std::make_shared(_generation_tracker, _statusline)}, - {'k', std::make_shared(Vector2::up(), _cursor_controller, - _window)}, - {'j', std::make_shared(Vector2::down(), _cursor_controller, - _window)}, - {'h', std::make_shared(Vector2::left(), _cursor_controller, - _window)}, - {'l', std::make_shared(Vector2::right(), - _cursor_controller, _window)}}; + return { { 'q', std::make_shared() }, + { 'i', std::make_shared(_cursor_controller, _scene) }, + { 'p', + std::make_shared(_generation_tracker, _statusline) }, + { 'k', + std::make_shared( + Vector2::up(), + _cursor_controller, + _window + ) }, + { 'j', + std::make_shared( + Vector2::down(), + _cursor_controller, + _window + ) }, + { 'h', + std::make_shared( + Vector2::left(), + _cursor_controller, + _window + ) }, + { 'l', + std::make_shared( + Vector2::right(), + _cursor_controller, + _window + ) } }; } -- cgit v1.2.3-18-g5258