mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-05-01 01:17:44 +00:00
Improve openings database code
This commit is contained in:
parent
b7667d1d40
commit
3b11b9d4f3
19 changed files with 3709 additions and 28331 deletions
21
src/Openings.hpp
Normal file
21
src/Openings.hpp
Normal file
|
@ -0,0 +1,21 @@
|
|||
#pragma once
|
||||
|
||||
#include "binres/openings.hpp"
|
||||
#include "pgnp.hpp"
|
||||
|
||||
/**
|
||||
* @brief Guess the opening using the Lichess Opening Database
|
||||
* See: https://github.com/lichess-org/chess-openings
|
||||
*/
|
||||
class Openings {
|
||||
typedef std::vector<std::string> MoveList;
|
||||
typedef std::vector<std::tuple<std::string,std::string,std::string>> Volume;
|
||||
|
||||
Volume A,B,C,D,E;
|
||||
void SearchOpening(const pgnp::HalfMove *moves,std::string &name, std::string &eco);
|
||||
void LoadVolume(const std::string &tsv, Volume *vol);
|
||||
public:
|
||||
void GuessOpening(const std::string &SANMoves, std::string &name, std::string &eco);
|
||||
void GuessOpening(const pgnp::HalfMove *moves, std::string &name, std::string &eco);
|
||||
Openings();
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue