diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-01-13 10:42:57 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-01-13 10:42:57 +0100 |
| commit | f754a93f9f13fa7f30386caba397b91e127aab2c (patch) | |
| tree | 9b3cd0a464d40657a9ed252f7065403669c8b9de /src/game_tab/Game.hpp | |
| parent | 7009469e96505ab7c2445e7dea43d6c6d2fcbd08 (diff) | |
Debug MainWindow and add comments
Diffstat (limited to 'src/game_tab/Game.hpp')
| -rw-r--r-- | src/game_tab/Game.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/game_tab/Game.hpp b/src/game_tab/Game.hpp index ddf5cf6..6f9bbb7 100644 --- a/src/game_tab/Game.hpp +++ b/src/game_tab/Game.hpp @@ -5,13 +5,19 @@ #include "ochess.hpp" #include <unordered_map> +/** + * @brief Hold an entire chess game + * Used in many places in the projects. + */ class Game { + /// @brief 64 char string that contains all the pieces on the board (used in BoardCanvas) std::string board; std::string initial_fen; std::string result; std::unordered_map<std::string, std::string> tags; HalfMove *moves; HalfMove *current; + /// @brief Used by various methods of the class chessarbiter::ChessArbiter arbiter; public: @@ -29,12 +35,15 @@ public: HalfMove *GetMoves(); std::string GetFen(); std::string GetResult(); + /// @brief Play the given absolute move bool Play(std::string move,char promotion='q'); bool IsBlackToPlay(); bool IsCheckmate(bool forBlack); + /// @brief Check if a given absolute move consists in a pawn promotion bool IsPromotionMove(std::string absolute_move); void Previous(); void Next(); + /// @brief Delete a move (its mainline and variations recursively) void DeleteMove(HalfMove *m); void PromoteMove(HalfMove *m); void SetMoveAsMainline(HalfMove *m); |
