summaryrefslogtreecommitdiff
path: root/Userland/Services/ChessEngine/main.cpp
diff options
context:
space:
mode:
authorTim Ledbetter <timledbetter@gmail.com>2023-04-01 23:18:10 +0100
committerSam Atkins <atkinssj@gmail.com>2023-04-20 09:59:18 +0100
commitc2b9376409fe06f8ca3bb03d39a793a3e78c7c1e (patch)
treeef50f12135685da1acb759d27b202754e4df4729 /Userland/Services/ChessEngine/main.cpp
parent13dbc69c23ddeab40eedb0e0edf93fc8e699b6e6 (diff)
downloadserenity-c2b9376409fe06f8ca3bb03d39a793a3e78c7c1e.zip
ChessEngine: Handle the UCI quit command
Diffstat (limited to 'Userland/Services/ChessEngine/main.cpp')
-rw-r--r--Userland/Services/ChessEngine/main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Services/ChessEngine/main.cpp b/Userland/Services/ChessEngine/main.cpp
index a16ca4e8a2..ddc7058ed0 100644
--- a/Userland/Services/ChessEngine/main.cpp
+++ b/Userland/Services/ChessEngine/main.cpp
@@ -17,5 +17,9 @@ ErrorOr<int> serenity_main(Main::Arguments)
TRY(Core::System::unveil(nullptr, nullptr));
auto engine = TRY(ChessEngine::try_create(Core::DeprecatedFile::standard_input(), Core::DeprecatedFile::standard_output()));
+ engine->on_quit = [&](auto status_code) {
+ loop.quit(status_code);
+ };
+
return loop.exec();
}