From 336eae219b06792424b05418dc95620239dd63ab Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Sun, 30 Apr 2023 17:35:40 +0100 Subject: [PATCH] Chess: Spawn new engine process immediately after engine is selected A new engine process is now started immediately, rather than waiting until a move needs to be made. This means that if the engine is playing as black, it can start up while the human player is making a move. This is noticable with stockfish, which can be slow to start up. --- Userland/Games/Chess/Engine.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Games/Chess/Engine.cpp b/Userland/Games/Chess/Engine.cpp index 8f8b95227b..83825e7d6c 100644 --- a/Userland/Games/Chess/Engine.cpp +++ b/Userland/Games/Chess/Engine.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 2020, the SerenityOS developers. + * Copyright (c) 2023, Tim Ledbetter * * SPDX-License-Identifier: BSD-2-Clause */ @@ -19,6 +20,7 @@ Engine::~Engine() Engine::Engine(StringView command) : m_command(command) { + connect_to_engine_service(); } void Engine::connect_to_engine_service()