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

LibChess: Add the ucinewgame command

This command is sent from the GUI to tell the engine that the next
position will be from a different game.
This commit is contained in:
Tim Ledbetter 2023-04-26 19:00:48 +01:00 committed by Andreas Kling
parent 7e6341587b
commit 18735960de
4 changed files with 30 additions and 0 deletions

View file

@ -56,6 +56,8 @@ void Endpoint::event(Core::Event& event)
return handle_info(static_cast<InfoCommand const&>(event));
case Command::Type::Quit:
return handle_quit();
case Command::Type::UCINewGame:
return handle_ucinewgame();
default:
Object::event(event);
break;
@ -115,6 +117,8 @@ NonnullOwnPtr<Command> Endpoint::read_command()
return InfoCommand::from_string(line).release_value_but_fixme_should_propagate_errors();
} else if (line.starts_with("quit"sv)) {
return QuitCommand::from_string(line).release_value_but_fixme_should_propagate_errors();
} else if (line.starts_with("ucinewgame"sv)) {
return UCINewGameCommand::from_string(line).release_value_but_fixme_should_propagate_errors();
}
dbgln("command line: {}", line);