diff options
Diffstat (limited to 'src/interfaces')
-rw-r--r-- | src/interfaces/cell_helper.hpp | 37 | ||||
-rw-r--r-- | src/interfaces/game.hpp | 2 | ||||
-rw-r--r-- | src/interfaces/input.hpp | 4 | ||||
-rw-r--r-- | src/interfaces/matrix.hpp | 11 | ||||
-rw-r--r-- | src/interfaces/statusline.hpp | 2 |
5 files changed, 43 insertions, 13 deletions
diff --git a/src/interfaces/cell_helper.hpp b/src/interfaces/cell_helper.hpp new file mode 100644 index 0000000..141d905 --- /dev/null +++ b/src/interfaces/cell_helper.hpp @@ -0,0 +1,37 @@ +#pragma once + +#include "interfaces/matrix.hpp" + +#include "engine/data/vector2.hpp" + +#include <yacppdic/factory.hpp> + +#include <list> +#include <memory> + +// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) +class ICellHelper +{ +public: + virtual ~ICellHelper() noexcept = default; + + [[nodiscard]] virtual auto is_cell_dying(const Vector2 &cell_pos) const noexcept + -> bool = 0; + + [[nodiscard]] virtual auto + get_birth_cell_positions(const std::list<Vector2> &cell_positions) const noexcept + -> std::list<Vector2> = 0; + + /* + [[nodiscard]] virtual auto + find_neighbour_cells(const Vector2 &cell_pos) const noexcept + -> std::list<Vector2> = 0; + */ + + [[nodiscard]] virtual auto find_neighbours(const Vector2 &cell_pos) const noexcept + -> std::list<Vector2> = 0; +}; + +template <typename MatrixElement> +using ICellHelperFactory = + yacppdic::Factory<std::unique_ptr<ICellHelper>(const IMatrix<MatrixElement> &matrix)>; diff --git a/src/interfaces/game.hpp b/src/interfaces/game.hpp index e205fae..b6d7f36 100644 --- a/src/interfaces/game.hpp +++ b/src/interfaces/game.hpp @@ -24,4 +24,4 @@ public: using IGameFactory = yacppdic::Factory<std::unique_ptr<IGame>( const std::shared_ptr<IScene> &scene, const std::shared_ptr<ICursorController> &cursor_controller, - const std::shared_ptr<IUserInputObserver> user_input_observer)>; + const std::shared_ptr<IUserInputObserver> &user_input_observer)>; diff --git a/src/interfaces/input.hpp b/src/interfaces/input.hpp index c2ecefb..3558363 100644 --- a/src/interfaces/input.hpp +++ b/src/interfaces/input.hpp @@ -13,9 +13,9 @@ public: virtual void listen() noexcept = 0; - virtual bool is_key_pressed(Key key) noexcept = 0; + virtual auto is_key_pressed(Key key) noexcept -> bool = 0; - virtual Key get_currently_pressed_key() const noexcept = 0; + [[nodiscard]] virtual auto get_currently_pressed_key() const noexcept -> Key = 0; virtual void clear_currently_pressed() noexcept = 0; }; diff --git a/src/interfaces/matrix.hpp b/src/interfaces/matrix.hpp index 5a01943..010138f 100644 --- a/src/interfaces/matrix.hpp +++ b/src/interfaces/matrix.hpp @@ -9,15 +9,10 @@ #include <memory> template <typename Element> +// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) class IMatrix { public: - IMatrix() noexcept = default; - - IMatrix(const IMatrix &matrix) noexcept = default; - - IMatrix(IMatrix &&matrix) noexcept = default; - virtual ~IMatrix() noexcept = default; virtual void fill(Element element) noexcept = 0; @@ -33,10 +28,6 @@ public: [[nodiscard]] virtual auto begin() const noexcept -> MatrixIterator<Element> = 0; [[nodiscard]] virtual auto end() const noexcept -> MatrixIterator<Element> = 0; - - auto operator=(const IMatrix &matrix) noexcept -> IMatrix & = default; - - auto operator=(IMatrix &&matrix) noexcept -> IMatrix & = default; }; template <typename Element> diff --git a/src/interfaces/statusline.hpp b/src/interfaces/statusline.hpp index 2fefa6d..a71699e 100644 --- a/src/interfaces/statusline.hpp +++ b/src/interfaces/statusline.hpp @@ -15,6 +15,8 @@ enum StatusLineSection D = 3, E = 4, F = 5, + G = 6, + H = 7 }; // NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) |