aboutsummaryrefslogtreecommitdiff
path: root/src/Openings.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Openings.hpp')
-rw-r--r--src/Openings.hpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/Openings.hpp b/src/Openings.hpp
index adf05c1..f3dfb6d 100644
--- a/src/Openings.hpp
+++ b/src/Openings.hpp
@@ -8,14 +8,41 @@
* See: https://github.com/lichess-org/chess-openings
*/
class Openings {
- typedef std::vector<std::string> MoveList;
+ /// @brief Loaded tsv data format as a vector of tuples (<eco>,<name>,<pgn-moves-list>)
typedef std::vector<std::tuple<std::string,std::string,std::string>> Volume;
Volume A,B,C,D,E;
+ /**
+ * @brief Search opening name an ECO code based on the given \a moves
+ *
+ * @param moves Half moves that you want to search for the opening
+ * @param name Fill by the method if opening is found
+ * @param eco Fill by the method if opening is found
+ */
void SearchOpening(const pgnp::HalfMove *moves,std::string &name, std::string &eco);
+ /**
+ * @brief Load a volume using tsv data (see openings.hpp)
+ *
+ * @param tsv data to load
+ * @param vol volume in which the data will be loaded
+ */
void LoadVolume(const std::string &tsv, Volume *vol);
public:
+ /**
+ * @brief Guess the opening based on a list of SAN moves (PGN)
+ *
+ * @param SANMoves
+ * @param name
+ * @param eco
+ */
void GuessOpening(const std::string &SANMoves, std::string &name, std::string &eco);
+ /**
+ * @brief Guess the opening based on a half moves (wrapper around ::SearchOpening)
+ *
+ * @param moves
+ * @param name
+ * @param eco
+ */
void GuessOpening(const pgnp::HalfMove *moves, std::string &name, std::string &eco);
Openings();
}; \ No newline at end of file