From 56252f2b6c42fe369a4b0c77287469c49c381943 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Mon, 2 Jan 2023 11:36:13 +0100 Subject: Improve UI --- src/game_tab/Game.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/game_tab/Game.cpp') diff --git a/src/game_tab/Game.cpp b/src/game_tab/Game.cpp index 8ab67cb..53be08f 100644 --- a/src/game_tab/Game.cpp +++ b/src/game_tab/Game.cpp @@ -92,6 +92,14 @@ void Game::SetMoveAsMainline(HalfMove *m) { } } +bool Game::IsCheckmate(bool forBlack){ + arbiter.Setup(GetFen()); + if(forBlack){ + return arbiter.IsBlackTurn() && arbiter.IsCheckMate(); + } + return !arbiter.IsBlackTurn() && arbiter.IsCheckMate(); +} + bool Game::Play(std::string move) { wxLogDebug("Playing move %s", move); std::string fen = GetFen(); -- cgit v1.2.3