mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 01:26:22 +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:
parent
7e6341587b
commit
18735960de
Notes:
sideshowbarker
2024-07-17 05:09:48 +09:00
Author: https://github.com/tcl3
Commit: 18735960de
Pull-request: https://github.com/SerenityOS/serenity/pull/18523
4 changed files with 30 additions and 0 deletions
|
@ -348,4 +348,17 @@ ErrorOr<String> QuitCommand::to_string() const
|
|||
return "quit\n"_short_string;
|
||||
}
|
||||
|
||||
ErrorOr<NonnullOwnPtr<UCINewGameCommand>> UCINewGameCommand::from_string(StringView command)
|
||||
{
|
||||
auto tokens = command.split_view(' ');
|
||||
VERIFY(tokens[0] == "ucinewgame");
|
||||
VERIFY(tokens.size() == 1);
|
||||
return adopt_nonnull_own_or_enomem(new (nothrow) UCINewGameCommand);
|
||||
}
|
||||
|
||||
ErrorOr<String> UCINewGameCommand::to_string() const
|
||||
{
|
||||
return "ucinewgame\n"_string;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue