Skip to content

Interface: Game ​

A game: frozen, plain data. JSON.stringify(game) gives these fields. Only values made by this module's functions are games; a copy or a plain object is refused.

Properties ​

PropertyModifierTypeDescription
currentreadonly{ children: readonly string[]; comment: string | null; id: string; marks: readonly Mark[]; parentId: string | null; }The move being viewed: where it sits in the record, and its marks and comment.
current.childrenreadonlyreadonly string[]-
current.commentreadonlystring | null-
current.idreadonlystring-
current.marksreadonlyreadonly Mark[]-
current.parentIdreadonlystring | null-
komireadonlynumberPoints added to White's score.
lastMovereadonlyMove | null-
modereadonlyMode-
moveNumberreadonlynumber-
movesreadonlyreadonly MoveSummary[]Every move in the record, parents before children, variations in order.
phasereadonly"playing" | "scoring" | "over"'scoring' after two passes in a row, while groups are marked; 'over' at the move where the game ended (an accepted score, a resignation, or a file's result). Moves wait in both.
prisonersreadonlyReadonly<Record<Color, number>>Stones each side has captured.
rulesreadonlyRules-
scorereadonlyScore | nullThe count while scoring and once the game is over; null while playing.
sizereadonlySize-
stonesreadonlyreadonly Readonly<Stone>[]The position at the move being viewed.
toPlayreadonlyColor-

Released under the MIT License.