aboutsummaryrefslogtreecommitdiff
path: root/src/game/cell_helper_impl.hpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-06-25 16:19:02 +0200
committerHampusM <hampus@hampusmat.com>2022-06-25 16:19:02 +0200
commit696b97147c2e399be7a95cc5a983294eebc84ff0 (patch)
treed49b2da4fc656867f9ea007a43935001078d022e /src/game/cell_helper_impl.hpp
parentca3765ccbbcaee691d71e4f995ff639682d7346f (diff)
refactor: make cell helper find_neighbour_cells return std::vector
Diffstat (limited to 'src/game/cell_helper_impl.hpp')
-rw-r--r--src/game/cell_helper_impl.hpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/game/cell_helper_impl.hpp b/src/game/cell_helper_impl.hpp
index ebb35aa..b7da413 100644
--- a/src/game/cell_helper_impl.hpp
+++ b/src/game/cell_helper_impl.hpp
@@ -41,7 +41,7 @@ auto CellHelper<MatrixElement>::get_birth_cell_positions(
for (const auto &cell_pos : cell_positions)
{
- const std::list<Vector2> empty_neighbour_positions =
+ const std::vector<Vector2> empty_neighbour_positions =
container_filter(find_neighbours(cell_pos), has_matrix_value(_matrix, ' '));
all_empty_neighbour_positions.insert(
@@ -70,9 +70,9 @@ auto CellHelper<MatrixElement>::get_birth_cell_positions(
template <typename MatrixElement>
auto CellHelper<MatrixElement>::find_neighbours(const Vector2 &cell_pos) const noexcept
- -> std::list<Vector2>
+ -> std::vector<Vector2>
{
- std::list<Vector2> cell_positions = {};
+ std::vector<Vector2> cell_positions = {};
const auto matrix_size =
Bounds({.width = _matrix.get_column_cnt(), .height = _matrix.get_row_cnt()});
@@ -91,8 +91,8 @@ auto CellHelper<MatrixElement>::find_neighbours(const Vector2 &cell_pos) const n
}
template <typename MatrixElement>
-auto CellHelper<MatrixElement>::_get_position_neighbours(
- const Vector2 &position) noexcept -> std::list<Vector2>
+auto CellHelper<MatrixElement>::_get_position_neighbours(const Vector2 &position) noexcept
+ -> std::list<Vector2>
{
return {
position + Vector2::up(),