Abstract
Abstract
addAdd the given NAG to the current node or variation.
Abstract
clearErase all the moves in the current Variation: after that, Variation.first returns undefined
.
If the current Variation is already empty (i.e. if Variation.first returns undefined
already),
nothing happens.
Abstract
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.
AbstractNode.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
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
).
AbstractNode.tags for more details on tags.
Abstract
finalFENFEN representation of the chess position at the end of the variation.
The fifty-move clock and full-move number are set according to the underlying game in the string returned by this method.
Abstract
finalAbstract
firstAbstract
hasCheck whether the current node or variation has the given NAG or not.
Abstract
idAbstract
initialFENFEN representation of the chess position at the beginning of the variation.
The fifty-move clock and full-move number are set according to the underlying game in the string returned by this method.
Abstract
initialNumber of half-moves since the last pawn move or capture at the beginning of the variation (see Node.fiftyMoveClock).
Abstract
initialFull-move number at the beginning of the variation (see Node.fullMoveNumber).
Abstract
initialAbstract
isAbstract
isAbstract
nagsNAGs associated to the current node or variation.
array sorted in increasing order.
Abstract
nodesAbstract
parentReturn the Node to which the current variation is attached.
undefined
if the current variation is the main one (see Game.mainVariation).
Abstract
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.
SAN representation of the move, or '--'
for a null-move.
The newly created Node.
exception.InvalidNotation if the move notation cannot be parsed, or if the parsed move would correspond to an illegal move.
Abstract
plyAbstract
removeRemove the given NAG from the current node or variation.
Abstract
tagGet the value associated to the given tag key on the current node or variation.
AbstractNode.tags for more details on tags.
Set the value associated to the given tag key on the current node or variation.
If undefined
, the existing value (if any) is erased.
AbstractNode.tags for more details on tags.
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.
Represent one variation in the tree structure formed by a chess game, meaning a starting chess position and a list of moves played consecutively from this position.