|
Cute Chess
0.1
|
A node in the ECO tree (Encyclopaedia of Chess Openings) More...
#include <econode.h>
Public Member Functions | |
| EcoNode * | child (const QString &sanMove) const |
| QString | ecoCode () const |
| bool | isLeaf () const |
| QString | opening () const |
| QString | variation () const |
| ~EcoNode () | |
Static Public Member Functions | |
| static const EcoNode * | find (const QVector< PgnGame::MoveData > &moves) |
| static void | initialize () |
| static void | initialize (PgnStream &in) |
| static const EcoNode * | root () |
| static void | write (const QString &fileName) |
Friends | |
| LIB_EXPORT QDataStream & | operator<< (QDataStream &out, const EcoNode *node) |
| LIB_EXPORT QDataStream & | operator>> (QDataStream &in, EcoNode *&node) |
A node in the ECO tree (Encyclopaedia of Chess Openings)
The EcoNode class can be used to generate and query a database (a tree) of known chess openings that belong to the Encyclopaedia of Chess Openings. More about ECO: http://en.wikipedia.org/wiki/Encyclopaedia_of_Chess_Openings
The ECO tree can be generated from a PGN collection or from a binary file that's part of the cutechess library (the default). A node corresponding to a PgnGame can be found by traversing the ECO tree as new moves are added to the game, or by passing all the moves at once to the find() function.
| EcoNode::~EcoNode | ( | ) |
Destroys the node and its subtree.
Returns the node's child node corresponding to sanMove, or 0 if no match is found.
| QString EcoNode::ecoCode | ( | ) | const |
Returns the node's ECO code, or an empty string if the node is an inner node.
|
static |
Returns the deepest node (closest to the leaves) that matches the opening sequence in moves.
|
static |
Initializes the ECO tree from the internal opening database.
|
static |
Initializes the ECO tree by parsing the PGN games in in.
| bool EcoNode::isLeaf | ( | ) | const |
Returns true if the node is a leaf node; otherwise returns false. A leaf node is a node that counts as an opening and has an ECO code and a name.
| QString EcoNode::opening | ( | ) | const |
Returns the node's opening name, or an empty string if the node is an inner node.
|
static |
Returns the root node of the ECO tree. initialize() is called first if the tree is uninitialized.
| QString EcoNode::variation | ( | ) | const |
Returns the node's variation name, or an empty string if the node is an inner node or doesn't have a variation name.
|
static |
Writes the ECO tree in binary format to fileName.
|
friend |
Writes the node node to stream out.
|
friend |
Reads a node from stream in into node. node should be a null or uninitialized pointer.
1.8.11