Skip to content

Function: getNeighbors() ​

ts
function getNeighbors(tileId, neighborMap): number[];

Returns the direct neighbour tile ids for a given tile.

Parameters ​

ParameterTypeDescription
tileIdnumberSource tile id.
neighborMapMap<number, number[]>Pre-computed map from buildNeighborMap().

Returns ​

number[]

Array of neighbour tile ids (5 for pentagons, 6 for hexagons).

Distribué sous la licence indiquée dans le dépôt.