Get the name of the annotator.
Set the name of the annotator.
If undefined, the existing value (if any) is erased.
Return a human-readable string representing the game. This string is multi-line, and is intended to be displayed in a fixed-width font (similarly to an ASCII-art picture).
Clear all the headers (player names, elos, titles, event name, date, etc...).
The Game.result header is reseted to its default value. The initial position and moves are not modified.
Get the date of the game.
Set the date of the game.
If undefined, the existing value (if any) is erased.
Set the date of the game.
If the month and/or the day of month are missing, the date of the game will be partially defined (see DateValue for more details regarding partially defined dates).
Optionalmonth: numberOptionalday: numberGet the date of the game as a standard JavaScript Date object.
If the day of month is undefined for the current game, the returned Date object points at the first day of the corresponding month.
If neither the day of month nor the month are undefined for the current game, the returned Date object points at the first day of the corresponding year.
Get the date of the game as a human-readable string (e.g. 'November 1955', 'September 4, 2021').
Optionallocales: string | string[]Locales to use to generate the result. If undefined, the default locale of the execution environment is used. See Intl documentation for more details.
Get the event.
Set the event.
If undefined, the existing value (if any) is erased.
FEN representation of the chess position at the end of the game.
The fifty-move clock and full-move number are set according to the move history in the string returned by this method.
Chess position at the end of the game.
Return the node or variation corresponding to the given ID (see Node.id and Variation.id to retrieve the ID of a node or variation).
For the main variation, IDs are built as follows:
'start' is the ID of the main variation,'3w' is for instance the ID of the node whose Node.fullMoveNumber is 3 and Node.moveColor is white
(i.e. the 3rd white move if the game starts from the usual initial position),'end' is an alias corresponding to the last node in the main variation (or the main variation itself if it is empty).For sub-variations, IDs are built as in the following examples:
'2b-v0-start' is the ID of the sub-variation at index 0 on node '2b' (in the main variation),'5w-v3-11b' is the ID of the node whose Node.fullMoveNumber is 11 and Node.moveColor is black within
the sub-variation at index 3 on node '5w' (in the main variation),'5w-v3-end' is an alias corresponding to the last node in this sub-variation (or the sub-variation itself if it is empty).If true, search id among both IDs and ID aliases. If false, search among IDs only.
undefined if the given ID does not correspond to an existing Node and Variation.
Get the round, sub-round and sub-sub-round as a human-readable string, the 3 components being separated by dot characters.
FEN representation of the chess position at the beginning of the game.
The fifty-move clock and full-move number are set according to the move history in the string returned by this method.
Full-move number at which the game starts.
The main variation of the game.
Return the nodes corresponding to the moves of the main variation.
If true, the nodes of the sub-variations are also included in the result.
Get the name of the opening.
Set the name of the opening.
If undefined, the existing value (if any) is erased.
Get the name of the opening sub-variation.
Set the name of the opening sub-variation.
If undefined, the existing value (if any) is erased.
Get the name of the opening variation.
Set the name of the opening variation.
If undefined, the existing value (if any) is erased.
Get the elo of the player corresponding to the given color.
If defined, the returned value is guaranteed to be an integer >= 0.
Set the elo of the player corresponding to the given color.
If undefined, the existing value (if any) is erased. Must be an integer >= 0.
Number of half-moves in the main variation.
For instance, after 1.e4 e5 2.Nf3, the number of half-moves if 3 (2 white moves + 1 black move).
Get the result of the game.
Get the round.
Set the round.
If undefined, the existing value (if any) is erased. Must be an integer >= 0.
Get where the game takes place.
Set where the game takes place.
If undefined, the existing value (if any) is erased.
Get the sub-round.
Set the sub-round.
If undefined, the existing value (if any) is erased. Must be an integer >= 0.
Get the sub-sub-round.
Set the sub-sub-round.
If undefined, the existing value (if any) is erased. Must be an integer >= 0.
Get the reason of the conclusion of the game. Examples of possible values:
'normal': game terminated in a normal fashion,'time forfeit': loss due to losing player's failure to meet time control requirements,'adjudication': result due to third party adjudication process,'death': losing player called to greater things, one hopes,'emergency': game concluded due to unforeseen circumstances,This list is not exhaustive and any string is valid value for this field.
Set the name of the opening sub-variation.
If undefined, the existing value (if any) is erased.
Get the chess game variant of the game.
Staticfromexception.InvalidPOJO if the given object cannot be decoded, either because it does not follow the schema defined by GamePOJO, or because it would result in an inconsistent game (e.g. if it contains some invalid moves).
Chess game, with the move history, the position at each step of the game, the comments and annotations (if any), the result of the game, and some meta-data such as the name of the players, the date of the game, the name of the tournament, etc...