#pragma once #include "ChessArbiter.hpp" #include "HalfMove.hpp" #include "ochess.hpp" #include class Game { std::string board; std::string initial_fen; std::string result; std::unordered_map tags; HalfMove *moves; HalfMove *current; chessarbiter::ChessArbiter arbiter; public: Game(const Game* g); Game(); Game(std::string fen); Game(HalfMove *m, std::string initial_fen); ~Game(); std::string GetBoard(); std::string GetTag(std::string tagname); void SetTag(std::string tagname, std::string value); void DeleteTag(std::string tagname); HalfMove *GetCurrentMove(); HalfMove *GetNextMove(); HalfMove *GetMoves(); std::string GetFen(); std::string GetResult(); bool Play(std::string move,char promotion='q'); bool IsBlackToPlay(); bool IsCheckmate(bool forBlack); void Previous(); void Next(); void DeleteMove(HalfMove *m); void PromoteMove(HalfMove *m); void SetMoveAsMainline(HalfMove *m); void SetCurrent(HalfMove *m); std::vector ListTags(); void SetResult(std::string result); /** * @brief Build current game * Verify and play all the moves in the game * while building the fen for each move */ void BuildAndVerify(); };