OChess v0.0.2
Programmer's Manual
Openings Class Reference

Guess the opening using the Lichess Opening Database See: https://github.com/lichess-org/chess-openings. More...

#include <Openings.hpp>

Public Member Functions

void GuessOpening (const std::string &SANMoves, std::string &name, std::string &eco)
 Guess the opening based on a list of SAN moves (PGN) More...
 
void GuessOpening (const pgnp::HalfMove *moves, std::string &name, std::string &eco)
 Guess the opening based on a half moves (wrapper around ::SearchOpening) More...
 

Private Types

typedef std::vector< std::tuple< std::string, std::string, std::string > > Volume
 Loaded tsv data format as a vector of tuples (<eco>,<name>,<pgn-moves-list>)
 

Private Member Functions

void SearchOpening (const pgnp::HalfMove *moves, std::string &name, std::string &eco)
 Search opening name an ECO code based on the given moves. More...
 
void LoadVolume (const std::string &tsv, Volume *vol)
 Load a volume using tsv data (see openings.hpp) More...
 

Private Attributes

Volume A
 
Volume B
 
Volume C
 
Volume D
 
Volume E
 

Detailed Description

Guess the opening using the Lichess Opening Database See: https://github.com/lichess-org/chess-openings.

Member Function Documentation

◆ GuessOpening() [1/2]

void Openings::GuessOpening ( const pgnp::HalfMove *  moves,
std::string &  name,
std::string &  eco 
)

Guess the opening based on a half moves (wrapper around ::SearchOpening)

Parameters
moves
name
eco

◆ GuessOpening() [2/2]

void Openings::GuessOpening ( const std::string &  SANMoves,
std::string &  name,
std::string &  eco 
)

Guess the opening based on a list of SAN moves (PGN)

Parameters
SANMoves
name
eco

◆ LoadVolume()

void Openings::LoadVolume ( const std::string &  tsv,
Volume vol 
)
private

Load a volume using tsv data (see openings.hpp)

Parameters
tsvdata to load
volvolume in which the data will be loaded

◆ SearchOpening()

void Openings::SearchOpening ( const pgnp::HalfMove *  moves,
std::string &  name,
std::string &  eco 
)
private

Search opening name an ECO code based on the given moves.

Parameters
movesHalf moves that you want to search for the opening
nameFill by the method if opening is found
ecoFill by the method if opening is found

The documentation for this class was generated from the following files: