Reference · Redacted player and observer views
boardFeaturesfunction
Public board markings (camps, headquarters and lakes), with no role-dependent information.
Import it
import { boardFeatures } from "@johnmorrisdotca/gunjin/views";
Also exported from: @johnmorrisdotca/gunjin
Definition
function boardFeatures(mode: AuthoritativeMatch["mode"], width: number, height: number): { camps: Coordinate[]; headquarters: Coordinate[]; lakes: Coordinate[]; }
Parameters
| Name | Type | Description |
|---|---|---|
mode | GameMode | The native rule-mode key. |
width | number | The native board width in holes. |
height | number | The native board height in holes. |
Returns
{ camps: Coordinate[]; headquarters: Coordinate[]; lakes: Coordinate[]; }
Public board markings (camps, headquarters and lakes), with no role-dependent information.
Examples
import { boardFeatures } from "@johnmorrisdotca/gunjin/views";
console.log(boardFeatures("luzhanqi-mini",7,8));{
camps: [ { x: 1, y: 3 }, { x: 5, y: 3 }, { x: 1, y: 4 }, { x: 5, y: 4 } ],
headquarters: [ { x: 1, y: 0 }, { x: 5, y: 0 }, { x: 1, y: 7 }, { x: 5, y: 7 } ],
lakes: []
}What it prints (run when this page was built)