diff options
Diffstat (limited to 'src/game_tab')
| -rw-r--r-- | src/game_tab/Game.cpp | 5 | ||||
| -rw-r--r-- | src/game_tab/Game.hpp | 2 | ||||
| -rw-r--r-- | src/game_tab/HalfMove.cpp | 14 |
3 files changed, 13 insertions, 8 deletions
diff --git a/src/game_tab/Game.cpp b/src/game_tab/Game.cpp index b9181a9..2b2955a 100644 --- a/src/game_tab/Game.cpp +++ b/src/game_tab/Game.cpp @@ -139,5 +139,8 @@ std::string Game::GetPGN() { } pgn += moves->GetPGN(); } + pgn += " " + result; return (pgn); -}
\ No newline at end of file +} + +void Game::SetResult(std::string result) { this->result = result; } diff --git a/src/game_tab/Game.hpp b/src/game_tab/Game.hpp index 7cad269..348bff9 100644 --- a/src/game_tab/Game.hpp +++ b/src/game_tab/Game.hpp @@ -8,6 +8,7 @@ class Game { std::string board; std::string initial_fen; + std::string result; std::unordered_map<std::string, std::string> tags; HalfMove *moves; HalfMove *current; @@ -35,4 +36,5 @@ public: void SetCurrent(HalfMove *m); std::vector<std::string> ListTags(); std::string GetPGN(); + void SetResult(std::string result); };
\ No newline at end of file diff --git a/src/game_tab/HalfMove.cpp b/src/game_tab/HalfMove.cpp index 94d9a8c..2b84382 100644 --- a/src/game_tab/HalfMove.cpp +++ b/src/game_tab/HalfMove.cpp @@ -115,16 +115,16 @@ void HalfMove::SetAsMainline() { HalfMove *HalfMove::GetMainline() { return (mainline); } -HalfMove::HalfMove(pgnp::HalfMove *m, std::string initial_fen): capture(' ') { +HalfMove::HalfMove(pgnp::HalfMove *m, std::string initial_fen) : capture(' ') { chessarbiter::ChessArbiter arbiter; arbiter.Setup(initial_fen); - bool work=arbiter.Play(arbiter.ParseSAN(m->move)); - if(!work){ - wxLogDebug("Bug! %s",m->move); + bool work = arbiter.Play(arbiter.ParseSAN(m->move)); + if (!work) { + wxLogDebug("Bug! %s", m->move); } - char capture=arbiter.GetCapture(); - if(capture != ' '){ - this->capture=capture; + char capture = arbiter.GetCapture(); + if (capture != ' ') { + this->capture = capture; } this->fen = arbiter.GetFEN(); this->move = m->move; |
