From eecf4b1e666211a13afa56f93477c55e8fd01621 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 2 Jun 2022 19:51:54 +0200 Subject: feat: implement game of life --- src/interfaces/cell_helper.hpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/interfaces/cell_helper.hpp (limited to 'src/interfaces/cell_helper.hpp') 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 + +#include +#include + +// 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 &cell_positions) const noexcept + -> std::list = 0; + + /* + [[nodiscard]] virtual auto + find_neighbour_cells(const Vector2 &cell_pos) const noexcept + -> std::list = 0; + */ + + [[nodiscard]] virtual auto find_neighbours(const Vector2 &cell_pos) const noexcept + -> std::list = 0; +}; + +template +using ICellHelperFactory = + yacppdic::Factory(const IMatrix &matrix)>; -- cgit v1.2.3-18-g5258