aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/Game.cpp
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2023-01-10 17:18:40 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2023-01-10 17:18:40 +0100
commit3bec014a331152b111b4eecb4864ba26d2ab9ae3 (patch)
treef1f524e69d27ea10e5dbab6c8a6a66007f78545b /src/game_tab/Game.cpp
parentb7e48fe351005700d779210a6dcf68158d4266fe (diff)
Update chessarbiter and finish the implementation of pawns promotions
Diffstat (limited to 'src/game_tab/Game.cpp')
-rw-r--r--src/game_tab/Game.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/game_tab/Game.cpp b/src/game_tab/Game.cpp
index def179c..315a4de 100644
--- a/src/game_tab/Game.cpp
+++ b/src/game_tab/Game.cpp
@@ -100,6 +100,12 @@ bool Game::IsCheckmate(bool forBlack){
return !arbiter.IsBlackTurn() && arbiter.IsCheckMate();
}
+bool Game::IsPromotionMove(std::string absolute_move){
+ arbiter.Setup(GetFen());
+ arbiter.Play(absolute_move);
+ return(arbiter.WasPawnPromotion());
+}
+
bool Game::Play(std::string move,char promotion) {
wxLogDebug("Playing move %s", move);
std::string fen = GetFen();