Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Static method: IEnumerable<int> AdjacentCells(int, int, int, bool)

Declaration

public static IEnumerable<int> AdjacentCells(
    int cell,
    int gridWidth,
    int gridHeight,
    bool includeDiagonals
)

Summary

Returns the set of cells adjacent to the specified cell.

Parameters

intcell The cell whose neighbors to examine.
intgridWidth The width of the grid.
intgridHeight The height of the grid.
boolincludeDiagonalstrue to include cells that are diagonally adjacent as well.