aboutsummaryrefslogtreecommitdiff
path: root/src/game/cell_helper.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/cell_helper.hpp')
-rw-r--r--src/game/cell_helper.hpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/game/cell_helper.hpp b/src/game/cell_helper.hpp
index c54b12e..0439269 100644
--- a/src/game/cell_helper.hpp
+++ b/src/game/cell_helper.hpp
@@ -1,33 +1,29 @@
#pragma once
-#include "interfaces/cell_helper.hpp"
-#include "interfaces/matrix.hpp"
-
-#include "engine/data/vector2.hpp"
-
#include <memory>
#include <vector>
+#include "engine/data/vector2.hpp"
+#include "interfaces/cell_helper.hpp"
+#include "interfaces/matrix.hpp"
+
template <typename MatrixElement>
class CellHelper : public ICellHelper
{
public:
explicit CellHelper(std::shared_ptr<IMatrix<MatrixElement>> matrix) noexcept;
- [[nodiscard]] auto is_cell_dying(const Vector2 &cell_pos) const noexcept
+ [[nodiscard]] auto compute_is_cell_dying(const Vector2 &cell_pos) const noexcept
-> bool override;
- [[nodiscard]] auto
- get_birth_cell_positions(const std::vector<Vector2> &cell_positions) const noexcept
- -> std::vector<Vector2> override;
-
- [[nodiscard]] auto find_neighbours(const Vector2 &cell_pos) const noexcept
+ [[nodiscard]] auto compute_birth_cell_positions(
+ const std::vector<Vector2> &cell_positions) const noexcept
-> std::vector<Vector2> override;
private:
const std::shared_ptr<IMatrix<MatrixElement>> _matrix;
- static auto _get_position_neighbours(const Vector2 &position) noexcept
+ [[nodiscard]] auto _get_valid_pos_neighbours(const Vector2 &position) const noexcept
-> std::vector<Vector2>;
};