A Book is a collection of chess positions, each with the corresponding ECO code, a mnemonic name, and the list of moves to reach the position.
More...
#include <book.h>
|
| std::string_view | findEcoString (const Position &position) const |
| | Retrieve an ECO string containing the ECO code and the mnemonic name.
|
| |
| Code | findEco (const Position &position) const |
| | Retrieve the ECO code of a position.
|
| |
|
std::vector< Line > | linesWithPrefix (std::string_view ecoPrefix) const |
| |
|
unsigned | lineCount () const |
| |
|
unsigned | fewestPieces () const |
| |
|
size_t | size () const |
| |
|
| static std::pair< Error, Book > | load (const std::filesystem::path &path) |
| | Read a file with a list of ECO codes and creates a Book object.
|
| |
A Book is a collection of chess positions, each with the corresponding ECO code, a mnemonic name, and the list of moves to reach the position.
◆ findEco()
| Code scid::eco::Book::findEco |
( |
const Position & |
position | ) |
const |
Retrieve the ECO code of a position.
- Parameters
-
| position | the position to search for. |
- Returns
- the corresponding ECO code or scid::eco::ECO_None if not found.
◆ findEcoString()
| std::string_view scid::eco::Book::findEcoString |
( |
const Position & |
position | ) |
const |
Retrieve an ECO string containing the ECO code and the mnemonic name.
- Parameters
-
| position | the position to search for. |
- Returns
- an empty string_view if the position is not found
◆ load()
| static std::pair< Error, Book > scid::eco::Book::load |
( |
const std::filesystem::path & |
path | ) |
|
|
static |
Read a file with a list of ECO codes and creates a Book object.
The file is composed of lines like this: C50a "Italian Game" 1.e4 e5 2.Nf3 Nc6 3.Bc4 *
- Parameters
-
| path | the path of the file to be read. |
- Returns
- on success, a std::pair containing scid::eco::OK and the newly created object.
- on failure, a std::pair containing an error code and an empty object.
The documentation for this class was generated from the following file:
- libs/eco/include/scid/eco/book.h