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);
            }
        }
示例#2
0
        public void CanRetrieveNeighborsOfCell()
        {
            var cell = _grid.GetCell(0, 0);

            Assert.AreEqual(_grid.GetNeighbors(cell).Length, 3);
        }