diff options
author | HampusM <hampus@hampusmat.com> | 2022-06-02 19:51:54 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:57:00 +0200 |
commit | eecf4b1e666211a13afa56f93477c55e8fd01621 (patch) | |
tree | 410510d6e058995174d5a5b0f535fb457a0c3542 /src/interfaces/cell_helper.hpp | |
parent | 87f55120f96d0f4f80b497dc9006d89df2dda125 (diff) |
feat: implement game of lifev0.1.0
Diffstat (limited to 'src/interfaces/cell_helper.hpp')
-rw-r--r-- | src/interfaces/cell_helper.hpp | 37 |
1 files changed, 37 insertions, 0 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)>; |