From 019337908e37ffee9b624b313e9d7f885bff9781 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 15 May 2022 19:57:02 +0200 Subject: style: change braced list & bracket style --- src/game/game.cpp | 76 ++++++++++++++++++++++--------------------------------- 1 file changed, 30 insertions(+), 46 deletions(-) (limited to 'src/game/game.cpp') diff --git a/src/game/game.cpp b/src/game/game.cpp index 02a0f65..4201b7b 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -17,8 +17,7 @@ Game::Game( std::shared_ptr generation_tracker, std::shared_ptr status_manager, IStatusLineSubscriberAdapterFactory - vector2_statusline_subscriber_adapter_factory -) noexcept + vector2_statusline_subscriber_adapter_factory) noexcept : _window(std::move(window)), _scene(std::move(scene)), _cursor_controller(std::move(cursor_controller)), @@ -26,8 +25,7 @@ Game::Game( _generation_tracker(std::move(generation_tracker)), _status_manager(std::move(status_manager)), _vector2_statusline_subscriber_adapter_factory( - vector2_statusline_subscriber_adapter_factory - ) + vector2_statusline_subscriber_adapter_factory) { } @@ -44,36 +42,31 @@ void Game::on_start() noexcept std::shared_ptr> vector2_statusline_subscriber_adapter = _vector2_statusline_subscriber_adapter_factory( _status_manager, - { StatusLineSection::B, StatusLineSection::C } - ); + {StatusLineSection::B, StatusLineSection::C}); _cursor_controller->subscribe( CursorEvent::POSITION_CHANGE, - vector2_statusline_subscriber_adapter - ); + vector2_statusline_subscriber_adapter); 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 }); + const auto center_position = Vector2( + {.x = static_cast(window_size.get_width()) / 2, + .y = static_cast(window_size.get_height()) / 2}); _cursor_controller->move_to(center_position); _status_manager->set_section_body( StatusLineSection::B, - fmt::format("{}", center_position.get_x()) - ); + fmt::format("{}", center_position.get_x())); _status_manager->set_section_body( StatusLineSection::C, - fmt::format("{}", center_position.get_y()) - ); + fmt::format("{}", center_position.get_y())); _status_manager->set_section_body( StatusLineSection::D, - _generation_tracker->get_is_paused() ? "yes" : "no" - ); + _generation_tracker->get_is_paused() ? "yes" : "no"); _status_manager->set_section_body(StatusLineSection::E, "0"); } @@ -99,33 +92,24 @@ 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, _status_manager) }, - { '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 - ) } - }; + {'q', std::make_shared()}, + {'i', std::make_shared(_cursor_controller, _scene)}, + {'p', std::make_shared(_generation_tracker, _status_manager)}, + {'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