Skip to content

Commit

Permalink
show debug print on title bar for #752
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiraoka committed Sep 21, 2020
1 parent aa7a276 commit a30bce0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/featurecat/lizzie/analysis/Leelaz.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class Leelaz {
private int currentCmdNum;
private ArrayDeque<String> cmdQueue;
private boolean isModifyingBoard = false;
private String lastSentCommand = "";

private Process process;

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -526,6 +534,7 @@ private void sendCommandToLeelaz(String command) {
try {
outputStream.write((command + "\n").getBytes());
outputStream.flush();
lastSentCommand = command;
} catch (IOException e) {
e.printStackTrace();
}
Expand Down

0 comments on commit a30bce0

Please sign in to comment.