mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-23 11:04:40 +00:00
ChessEngine: Reset the engine state on receiving a ucinewgame command
This commit is contained in:
parent
18735960de
commit
536f6b8b34
|
@ -74,3 +74,9 @@ void ChessEngine::handle_unexpected_eof()
|
|||
if (on_quit)
|
||||
on_quit(EPIPE);
|
||||
}
|
||||
|
||||
void ChessEngine::handle_ucinewgame()
|
||||
{
|
||||
m_board = Chess::Board();
|
||||
m_last_tree = {};
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ public:
|
|||
virtual void handle_position(Chess::UCI::PositionCommand const&) override;
|
||||
virtual void handle_go(Chess::UCI::GoCommand const&) override;
|
||||
virtual void handle_quit() override;
|
||||
virtual void handle_ucinewgame() override;
|
||||
virtual void handle_unexpected_eof() override;
|
||||
|
||||
Function<void(int)> on_quit;
|
||||
|
|
Loading…
Reference in a new issue