From a30bce0903fa26b5f17ba3471069444a18513984 Mon Sep 17 00:00:00 2001 From: Hiraoka Date: Mon, 21 Sep 2020 20:09:02 +0900 Subject: [PATCH] show debug print on title bar for #752 --- src/main/java/featurecat/lizzie/analysis/Leelaz.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/featurecat/lizzie/analysis/Leelaz.java b/src/main/java/featurecat/lizzie/analysis/Leelaz.java index 438f9f2fc..41a35c8fb 100644 --- a/src/main/java/featurecat/lizzie/analysis/Leelaz.java +++ b/src/main/java/featurecat/lizzie/analysis/Leelaz.java @@ -40,6 +40,7 @@ public class Leelaz { private int currentCmdNum; private ArrayDeque cmdQueue; private boolean isModifyingBoard = false; + private String lastSentCommand = ""; private Process process; @@ -364,6 +365,7 @@ private void parseLine(String line) { } String[] params = line.trim().split(" "); currentCmdNum = Integer.parseInt(params[0].substring(1).trim()); + debugPrint(line); trySendCommandFromQueue(); @@ -420,6 +422,12 @@ private void parseLine(String line) { } } + private void debugPrint(String line) { + Lizzie.frame.setPlayers( + String.format("<%d %d %d> %s", cmdNumber, currentCmdNum, cmdQueue.size(), lastSentCommand), + line); + } + /** * Parse a move-data line of Leelaz output * @@ -526,6 +534,7 @@ private void sendCommandToLeelaz(String command) { try { outputStream.write((command + "\n").getBytes()); outputStream.flush(); + lastSentCommand = command; } catch (IOException e) { e.printStackTrace(); }