Class: Space<G, P>
Spaces are areas of the game. The spaces of your game are declared during setup in createGame and never change during play.
Type parameters
Name | Type |
---|---|
G | extends BaseGame |
P | extends Player = NonNullable <G ["player" ]> |
Hierarchy
-
GameElement
<G
,P
>↳
Space
↳↳
Game
Adjacency
isAdjacentTo
▸ isAdjacentTo(element
): boolean
If this element is adjacent to some other element, using the nearest containing space that has an adjacency map.
Parameters
Name | Type |
---|---|
element | GameElement <BaseGame , BasePlayer > |
Returns
boolean
Inherited from
Defined in
boardzilla-core/src/board/element.ts:540
distanceTo
▸ distanceTo(element
): number
Finds the shortest distance between two spaces
Parameters
Name | Type | Description |
---|---|---|
element | GameElement <BaseGame , BasePlayer > | element to measure distance to |
Returns
number