private void GetRadiusNeighbors(EmberCell cell, int radius, List <EmberCell> cells) { if (radius == 0) { return; } var neighbors = _grid.GetNeighbors(cell); foreach (var neighbor in neighbors) { if (!cells.Contains(neighbor)) { cells.Add(neighbor); } GetRadiusNeighbors(neighbor, radius - 1, cells); } }
public void CanRetrieveNeighborsOfCell() { var cell = _grid.GetCell(0, 0); Assert.AreEqual(_grid.GetNeighbors(cell).Length, 3); }