From 696b97147c2e399be7a95cc5a983294eebc84ff0 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 25 Jun 2022 16:19:02 +0200 Subject: refactor: make cell helper find_neighbour_cells return std::vector --- src/game/cell_helper_impl.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/game/cell_helper_impl.hpp') 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::get_birth_cell_positions( for (const auto &cell_pos : cell_positions) { - const std::list empty_neighbour_positions = + const std::vector empty_neighbour_positions = container_filter(find_neighbours(cell_pos), has_matrix_value(_matrix, ' ')); all_empty_neighbour_positions.insert( @@ -70,9 +70,9 @@ auto CellHelper::get_birth_cell_positions( template auto CellHelper::find_neighbours(const Vector2 &cell_pos) const noexcept - -> std::list + -> std::vector { - std::list cell_positions = {}; + std::vector cell_positions = {}; const auto matrix_size = Bounds({.width = _matrix.get_column_cnt(), .height = _matrix.get_row_cnt()}); @@ -91,8 +91,8 @@ auto CellHelper::find_neighbours(const Vector2 &cell_pos) const n } template -auto CellHelper::_get_position_neighbours( - const Vector2 &position) noexcept -> std::list +auto CellHelper::_get_position_neighbours(const Vector2 &position) noexcept + -> std::list { return { position + Vector2::up(), -- cgit v1.2.3-18-g5258