Reference · Views, replay and player
ViewedPiecetype
Player-facing piece. Opponent kind is always null and opponent IDs are omitted.
Import it
import type { ViewedPiece } from "@johnmorrisdotca/gunjin";
Definition
type ViewedPiece = Coordinate & {
owner: Player;
kind: string | null;
hidden: boolean;
id?: string;
};
Members
| Name | Type | Description |
|---|---|---|
x | number | |
y | number | |
owner | Player | |
kind | string | null | |
hidden | boolean | |
id (optional) | string | undefined |
Examples
import type { ViewedPiece } from "@johnmorrisdotca/gunjin";
const value: ViewedPiece = {owner:1,x:0,y:0,kind:null,hidden:true};
console.log(value);{ owner: 1, x: 0, y: 0, kind: null, hidden: true }What it prints (run when this page was built)