Scid  4.7.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Functions
gamepos Namespace Reference

Classes

struct  GamePos
 

Functions

template<typename TCont >
void collectPositions (Game &game, TCont &dest)
 Iterate all the positions of a game and store the corresponding GamePos objects into a container. More...
 
std::vector< GamePoscollectPositions (Game &game)
 Returns all the positions of a game. More...
 

Function Documentation

◆ collectPositions() [1/2]

template<typename TCont >
void gamepos::collectPositions ( Game game,
TCont &  dest 
)
inline

Iterate all the positions of a game and store the corresponding GamePos objects into a container.

The order of positions and of Recursive Annotation Variations (RAV) follows the PGN standard: "The alternate move sequence given by an RAV is one that may be legally played by first unplaying the move that appears immediately prior to the RAV. Because the RAV is a recursive construct, it may be nested" Each position have a RAVdepth and a RAVnum that allows to follow a variation from any given position:

  • skip all the next positions with a bigger RAVdepth
  • the variation ends with:
    • a lower RAVdepth or
    • an equal RAVdepth but different RAVnum or
    • the end of dest
      Parameters
      gamereference to the Game object where the positions are read.
      destthe container where the GamePos objects are appended.

Definition at line 550 of file game.h.

◆ collectPositions() [2/2]

std::vector<GamePos> gamepos::collectPositions ( Game game)
inline

Returns all the positions of a game.

Parameters
gamereference to the Game object where the positions are read.
Returns
a std::vector containing the GamePos objects corresponding to all the positions of game.

Definition at line 578 of file game.h.