mooreNeighborhood

fun mooreNeighborhood(cell: Cell, includeSelf: Boolean = false): List<Cell>(source)

The 8 cells in the Moore neighborhood (Chebyshev distance 1) around cell. If includeSelf is true, cell is included. Cells outside the bounds are dropped for non-torus grids; for torus grids the full 8 (or 9 with self) are always returned.