aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-29 17:40:04 +0200
committerHampusM <hampus@hampusmat.com>2022-06-13 17:56:57 +0200
commita039c8ad36779903571419cb06cd052f8fc41512 (patch)
tree4fdced6941a048bdd4b032fab7012bca00a6028e /src/interfaces
parentacf72075ed32e5a679d49ffedc0c28d8ac2aea8b (diff)
refactor: use trailing return types
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/argument_parser.hpp10
-rw-r--r--src/interfaces/cursor.hpp2
-rw-r--r--src/interfaces/game.hpp4
-rw-r--r--src/interfaces/generation_tracker.hpp4
-rw-r--r--src/interfaces/matrix.hpp14
-rw-r--r--src/interfaces/randomization.hpp6
-rw-r--r--src/interfaces/scene.hpp4
-rw-r--r--src/interfaces/window.hpp2
8 files changed, 23 insertions, 23 deletions
diff --git a/src/interfaces/argument_parser.hpp b/src/interfaces/argument_parser.hpp
index efcbaf3..8769698 100644
--- a/src/interfaces/argument_parser.hpp
+++ b/src/interfaces/argument_parser.hpp
@@ -18,9 +18,9 @@ class IArgumentParser
public:
virtual ~IArgumentParser() noexcept = default;
- virtual ParsedArguments
- parse(const std::vector<option> &options, const std::string_view &short_options,
- const int &argc,
- char *const *argv) noexcept = 0; // NOLINT(cppcoreguidelines-avoid-c-arrays,
- // modernize-avoid-c-arrays)
+ virtual auto parse(const std::vector<option> &options,
+ const std::string_view &short_options, const int &argc,
+ char *const *argv) noexcept
+ -> ParsedArguments = 0; // NOLINT(cppcoreguidelines-avoid-c-arrays,
+ // modernize-avoid-c-arrays)
};
diff --git a/src/interfaces/cursor.hpp b/src/interfaces/cursor.hpp
index caa89df..f6521cb 100644
--- a/src/interfaces/cursor.hpp
+++ b/src/interfaces/cursor.hpp
@@ -27,7 +27,7 @@ public:
// NOLINTNEXTLINE(google-default-arguments)
virtual void move_to(const Vector2 &position, bool silent = false) noexcept = 0;
- [[nodiscard]] virtual Vector2 where() const noexcept = 0;
+ [[nodiscard]] virtual auto where() const noexcept -> Vector2 = 0;
virtual void ensure_position() noexcept = 0;
diff --git a/src/interfaces/game.hpp b/src/interfaces/game.hpp
index 3e547f5..46d79e4 100644
--- a/src/interfaces/game.hpp
+++ b/src/interfaces/game.hpp
@@ -20,8 +20,8 @@ public:
virtual void on_exit() const noexcept = 0;
- [[nodiscard]] virtual std::unordered_map<char, std::shared_ptr<ICommand>>
- get_input_config() const noexcept = 0;
+ [[nodiscard]] virtual auto get_input_config() const noexcept
+ -> std::unordered_map<char, std::shared_ptr<ICommand>> = 0;
};
using IGameFactory = std::shared_ptr<IGame> (*)(
diff --git a/src/interfaces/generation_tracker.hpp b/src/interfaces/generation_tracker.hpp
index 76f241a..fcd2426 100644
--- a/src/interfaces/generation_tracker.hpp
+++ b/src/interfaces/generation_tracker.hpp
@@ -9,9 +9,9 @@ class IGenerationTracker
public:
virtual ~IGenerationTracker() noexcept = default;
- [[nodiscard]] virtual uint32_t get_current_generation() const noexcept = 0;
+ [[nodiscard]] virtual auto get_current_generation() const noexcept -> uint32_t = 0;
- [[nodiscard]] virtual bool get_is_paused() const noexcept = 0;
+ [[nodiscard]] virtual auto get_is_paused() const noexcept -> bool = 0;
virtual void set_is_paused(bool is_paused) noexcept = 0;
};
diff --git a/src/interfaces/matrix.hpp b/src/interfaces/matrix.hpp
index 2b33342..edcf935 100644
--- a/src/interfaces/matrix.hpp
+++ b/src/interfaces/matrix.hpp
@@ -21,21 +21,21 @@ public:
virtual void fill(Element element) noexcept = 0;
- [[nodiscard]] virtual Element get(const Vector2 &pos) const noexcept = 0;
+ [[nodiscard]] virtual auto get(const Vector2 &pos) const noexcept -> Element = 0;
virtual void set(const Vector2 &pos, Element element) noexcept = 0;
- [[nodiscard]] virtual uint32_t get_row_cnt() const noexcept = 0;
+ [[nodiscard]] virtual auto get_row_cnt() const noexcept -> uint32_t = 0;
- [[nodiscard]] virtual uint32_t get_column_cnt() const noexcept = 0;
+ [[nodiscard]] virtual auto get_column_cnt() const noexcept -> uint32_t = 0;
- [[nodiscard]] virtual MatrixIterator<Element> begin() const noexcept = 0;
+ [[nodiscard]] virtual auto begin() const noexcept -> MatrixIterator<Element> = 0;
- [[nodiscard]] virtual MatrixIterator<Element> end() const noexcept = 0;
+ [[nodiscard]] virtual auto end() const noexcept -> MatrixIterator<Element> = 0;
- IMatrix &operator=(const IMatrix &matrix) noexcept = default;
+ auto operator=(const IMatrix &matrix) noexcept -> IMatrix & = default;
- IMatrix &operator=(IMatrix &&matrix) noexcept = default;
+ auto operator=(IMatrix &&matrix) noexcept -> IMatrix & = default;
};
template <typename Element>
diff --git a/src/interfaces/randomization.hpp b/src/interfaces/randomization.hpp
index 211360e..eb8bd30 100644
--- a/src/interfaces/randomization.hpp
+++ b/src/interfaces/randomization.hpp
@@ -8,7 +8,7 @@ class ISeedGenerator
public:
virtual ~ISeedGenerator() noexcept = default;
- [[nodiscard]] virtual uint32_t random_seed() const noexcept = 0;
+ [[nodiscard]] virtual auto random_seed() const noexcept -> uint32_t = 0;
};
using ISeedGeneratorFactory = std::shared_ptr<ISeedGenerator> (*)();
@@ -25,8 +25,8 @@ public:
* @param a A number lower than b
* @param b A number greater than a
*/
- [[nodiscard]] virtual uint32_t in_range(const uint32_t &a,
- const uint32_t &b) const noexcept = 0;
+ [[nodiscard]] virtual auto in_range(const uint32_t &a,
+ const uint32_t &b) const noexcept -> uint32_t = 0;
};
using IRandomNumberGeneratorFactory =
diff --git a/src/interfaces/scene.hpp b/src/interfaces/scene.hpp
index 3b440b0..3960985 100644
--- a/src/interfaces/scene.hpp
+++ b/src/interfaces/scene.hpp
@@ -16,8 +16,8 @@ public:
virtual void leave() noexcept = 0;
- [[nodiscard]] virtual const std::shared_ptr<IMatrix<std::string_view>> &
- get_matrix() const noexcept = 0;
+ [[nodiscard]] virtual auto get_matrix() const noexcept
+ -> const std::shared_ptr<IMatrix<std::string_view>> & = 0;
};
using ISceneFactory = std::shared_ptr<IScene> (*)(
diff --git a/src/interfaces/window.hpp b/src/interfaces/window.hpp
index d880762..6fc56e9 100644
--- a/src/interfaces/window.hpp
+++ b/src/interfaces/window.hpp
@@ -8,5 +8,5 @@ class IWindow
public:
virtual ~IWindow() noexcept = default;
- [[nodiscard]] virtual Bounds size() const noexcept = 0;
+ [[nodiscard]] virtual auto size() const noexcept -> Bounds = 0;
};