OChess v0.0.2
Programmer's Manual
|
Hold an entire chess game. Used in many places in the projects. More...
#include <Game.hpp>
Public Member Functions | |
Game (const Game *g) | |
Game (std::string fen) | |
Game (HalfMove *m, std::string initial_fen) | |
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 () |
void | GetOpening (std::string &name, std::string &eco) |
bool | Play (std::string move, char promotion='q') |
Play the given absolute move. | |
bool | IsBlackToPlay () |
bool | IsCheckmate (bool forBlack) |
bool | IsPromotionMove (std::string absolute_move) |
Check if a given absolute move consists in a pawn promotion. | |
void | Previous () |
void | Next () |
void | DeleteMove (HalfMove *m) |
Delete a move (its mainline and variations recursively) | |
void | PromoteMove (HalfMove *m) |
void | SetMoveAsMainline (HalfMove *m) |
void | SetCurrent (HalfMove *m) |
std::vector< std::string > | ListTags () |
void | SetResult (std::string result) |
void | BuildAndVerify () |
Build current game Verify and play all the moves in the game while building the fen for each move. | |
Private Attributes | |
HalfMove * | current |
64 char string that contains all the pieces on the board (used in BoardCanvas) | |
HalfMove * | moves |
std::string | board |
std::string | initial_fen |
std::string | result |
std::unordered_map< std::string, std::string > | tags |
chessarbiter::ChessArbiter | arbiter |
Used by various methods of the class. | |
Hold an entire chess game. Used in many places in the projects.