From a039c8ad36779903571419cb06cd052f8fc41512 Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 29 Mar 2022 17:40:04 +0200 Subject: refactor: use trailing return types --- src/game/game.cpp | 4 ++-- src/game/game.hpp | 4 ++-- src/game/generation_tracker.cpp | 4 ++-- src/game/generation_tracker.hpp | 4 ++-- src/game/statusline.cpp | 4 ++-- src/game/statusline.hpp | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/game') diff --git a/src/game/game.cpp b/src/game/game.cpp index 6632c08..88b9584 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -57,8 +57,8 @@ void Game::on_exit() const noexcept std::cout.flush(); } -std::unordered_map> -Game::get_input_config() const noexcept +auto Game::get_input_config() const noexcept + -> std::unordered_map> { return {{'q', std::make_shared()}, {'i', std::make_shared(_cursor_controller, _scene)}, diff --git a/src/game/game.hpp b/src/game/game.hpp index 5894a01..dfbe619 100644 --- a/src/game/game.hpp +++ b/src/game/game.hpp @@ -25,8 +25,8 @@ public: void on_exit() const noexcept override; - [[nodiscard]] std::unordered_map> - get_input_config() const noexcept override; + [[nodiscard]] auto get_input_config() const noexcept + -> std::unordered_map> override; private: std::shared_ptr _window; diff --git a/src/game/generation_tracker.cpp b/src/game/generation_tracker.cpp index 0e137cb..0a7a923 100644 --- a/src/game/generation_tracker.cpp +++ b/src/game/generation_tracker.cpp @@ -2,12 +2,12 @@ GenerationTracker::GenerationTracker(bool is_paused) noexcept : _is_paused(is_paused) {} -uint32_t GenerationTracker::get_current_generation() const noexcept +auto GenerationTracker::get_current_generation() const noexcept -> uint32_t { return _current_generation; } -bool GenerationTracker::get_is_paused() const noexcept +auto GenerationTracker::get_is_paused() const noexcept -> bool { return _is_paused; } diff --git a/src/game/generation_tracker.hpp b/src/game/generation_tracker.hpp index 0e59751..bd15a3e 100644 --- a/src/game/generation_tracker.hpp +++ b/src/game/generation_tracker.hpp @@ -9,9 +9,9 @@ class GenerationTracker : public IGenerationTracker public: explicit GenerationTracker(bool is_paused) noexcept; - [[nodiscard]] uint32_t get_current_generation() const noexcept override; + [[nodiscard]] auto get_current_generation() const noexcept -> uint32_t override; - [[nodiscard]] bool get_is_paused() const noexcept override; + [[nodiscard]] auto get_is_paused() const noexcept -> bool override; void set_is_paused(bool is_paused) noexcept override; diff --git a/src/game/statusline.cpp b/src/game/statusline.cpp index 221258c..6becb38 100644 --- a/src/game/statusline.cpp +++ b/src/game/statusline.cpp @@ -51,7 +51,7 @@ void StatusLine::set_status(StatusLineSection section, _move_back(previous_position); } -Vector2 StatusLine::_move_to_statusline(int32_t x) noexcept +auto StatusLine::_move_to_statusline(int32_t x) noexcept -> Vector2 { const auto previous_position = _cursor_controller->where(); @@ -72,7 +72,7 @@ void StatusLine::_move_back(Vector2 previous_position) noexcept _cursor_controller->show(); } -int32_t StatusLine::_get_section_start_x(StatusLineSection section) const noexcept +auto StatusLine::_get_section_start_x(StatusLineSection section) const noexcept -> int32_t { int32_t section_start = 0; diff --git a/src/game/statusline.hpp b/src/game/statusline.hpp index 7db1e0b..a14ab20 100644 --- a/src/game/statusline.hpp +++ b/src/game/statusline.hpp @@ -31,11 +31,11 @@ private: std::shared_ptr _cursor_controller; std::shared_ptr _window; - Vector2 _move_to_statusline(int32_t x) noexcept; + auto _move_to_statusline(int32_t x) noexcept -> Vector2; void _move_back(Vector2 previous_position) noexcept; - int32_t _get_section_start_x(StatusLineSection section) const noexcept; + auto _get_section_start_x(StatusLineSection section) const noexcept -> int32_t; void _clear_section(StatusLineSection section) noexcept; }; -- cgit v1.2.3-18-g5258