Exemplo n.º 1
0
 private IEnumerable <QuadrantInfo> GetNeighborhoodRow(Quadrant quadrant, int x) =>
 Enumerable.Range(-1, 3)
 .Select(dy => dy + quadrant.Coordinates.Y)
 .Select(y => y < 0 || y > 7 || x < 0 || x > 7 ? null : _quadrants[x][y]);
Exemplo n.º 2
0
 internal IEnumerable <IEnumerable <QuadrantInfo> > GetNeighborhood(Quadrant quadrant) =>
 Enumerable.Range(-1, 3)
 .Select(dx => dx + quadrant.Coordinates.X)
 .Select(x => GetNeighborhoodRow(quadrant, x));