1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 15:37:46 +00:00

Chess: Display appropriate dialog when engine move ends the game

A dialog is now displayed when an engine move results in a checkmate
or a draw. In the case of threefold repetition or the fifty move rule,
the engine will always accept a draw. A human player is asked if they
would like to accept a draw.
This commit is contained in:
Tim Ledbetter 2023-04-28 18:38:07 +01:00 committed by Andreas Kling
parent d9f0c2a806
commit e1de31a3fe
2 changed files with 55 additions and 56 deletions

View file

@ -111,11 +111,18 @@ public:
};
private:
enum class ClaimDrawBehavior {
Always,
Prompt
};
ChessWidget() = default;
virtual void config_string_did_change(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, DeprecatedString const& value) override;
virtual void config_bool_did_change(DeprecatedString const& domain, DeprecatedString const& group, DeprecatedString const& key, bool value) override;
bool check_game_over(ClaimDrawBehavior);
Chess::Board m_board;
Chess::Board m_board_playback;
bool m_playback { false };