Abstract
Abstract
addAdd the given NAG to the current node or variation.
Abstract
addAbstract
clearRemove all the NAGs from the current node or variation.
Abstract
clearRemove all the key-value tag pairs from the the current node or variation.
tags for more details on tags.
Abstract
commentGet the text comment (if any) associated to the current node or variation.
Set the text comment associated to the current node or variation.
If undefined
, the existing value (if any) is erased.
Optional
isLongComment: booleanfalse
by default.
Abstract
fenFEN representation of the chess position after the current move.
The fifty-move clock and full-move number are set according to the underlying game in the string returned by this method.
Abstract
fiftyAbstract
figurineSAN-like representation of the move
associated to the current node (or '--'
for a null-move).
Here, chess pieces are represented with their respective unicode character, instead of the first letter of their English name.
Abstract
filterRemove from the the current node or variation the NAGs
for which the given filter evaluates to false
(and keep those for which it evaluates to true
).
Abstract
filterRemove from the the current node or variation the key-value tag pairs for which the given filter evaluates to false
(and keep those for which it evaluates to true
).
tags for more details on tags.
Abstract
fullAbstract
hasCheck whether the current node or variation has the given NAG or not.
Abstract
idAbstract
isAbstract
moveAbstract
nagsAbstract
nextAbstract
notationSAN representation of the move
associated to the current node (or '--'
for a null-move).
Abstract
parentAbstract
playCreate a new node representing the given move, and append it to the current node or variation.
If there are some pre-existing subsequent nodes, they are all erased.
The newly created Node.
InvalidNotation if the move notation cannot be parsed, or if the parsed move would correspond to an illegal move.
SAN representation of the move, or '--'
for a null-move.
Abstract
positionAbstract
positionAbstract
previousAbstract
promoteReplace the move on the current node (and the following ones, if any) by the moves of the variation corresponding to the given index, and create a new variation with the move on the current node and its successors.
WARNING: the promoted variation must NOT be empty (otherwise an exception is thrown).
Index of the variation to promote (must be such that 0 <= variationIndex < thisNode.variations().length
).
Abstract
removeAbstract
removeRemove the given NAG from the current node or variation.
Abstract
removeErase all the moves before the one on the current Node: after that, parentVariation returns the main variation of the parent Game, and the current node is the first node of this variation.
This method modifies the initial position and initial full-move number of the parent Game.
Abstract
removeAbstract
swapChange the order of the variations by swapping the two variations corresponding to the given indexes.
Index of one variation to swap (must be such that 0 <= variationIndex1 < thisNode.variations().length
).
Index of the other variation to swap (must be such that 0 <= variationIndex2 < thisNode.variations().length
).
Abstract
tagGet the value associated to the given tag key on the current node or variation.
tags for more details on tags.
Set the value associated to the given tag key on the current node or variation.
tags for more details on tags.
If undefined
, the existing value (if any) is erased.
Abstract
tagsReturn the keys of the tags associated to the current node or variation.
The tag mechanism is a key-value associative container allowing to store some arbitrary data
on each node or variation. In PGN, the tags are represented as [%tagKey tagValue]
strings
appended to text comments.
The tag keys must be non-empty, and can contain only alphanumeric or underscore characters.
array sorted in increasing order.
Abstract
variationsGenerated using TypeDoc
Feb 25, 2024
Represent one move in the tree structure formed by a chess game with multiple variations.