From 75f5356a4e3bfe3c984acbfd5cbe0b394966c782 Mon Sep 17 00:00:00 2001 From: Astesana Date: Fri, 10 May 2024 10:32:05 +0200 Subject: [PATCH] Adapts to jchess-uci-client changes --- src/main/java/com/fathzer/jchess/bot/uci/UCIEngine.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/fathzer/jchess/bot/uci/UCIEngine.java b/src/main/java/com/fathzer/jchess/bot/uci/UCIEngine.java index a3ed71f..221ecbf 100644 --- a/src/main/java/com/fathzer/jchess/bot/uci/UCIEngine.java +++ b/src/main/java/com/fathzer/jchess/bot/uci/UCIEngine.java @@ -10,6 +10,7 @@ import com.fathzer.jchess.bot.Engine; import com.fathzer.jchess.bot.uci.EngineLoader.EngineData; import com.fathzer.jchess.settings.Settings.Variant; +import com.fathzer.uci.client.GoParameters; import com.fathzer.uci.client.GoReply.UCIMove; public class UCIEngine extends com.fathzer.uci.client.UCIEngine implements Engine { @@ -43,7 +44,12 @@ public void setPosition(String fen, List moves) throws IOException { @Override public String getMove(CountDownState params) throws IOException { - final List moves = super.go(new com.fathzer.uci.client.CountDownState(params.getRemainingMs(), params.getIncrementMs(), params.getMovesToGo())).getMoves(); + final GoParameters goParams = new GoParameters(); + final GoParameters.TimeControl tc = goParams.getTimeControl(); + tc.setRemainingMs(params.getRemainingMs()); + tc.setIncrementMs(params.getIncrementMs()); + tc.setMovesToGo(params.getMovesToGo()); + final List moves = super.go(goParams).getMoves(); return moves.isEmpty() ? null : moves.get(0).getMove(); }