Skip to content

Commit

Permalink
Bug fix in ExtendedUCI
Browse files Browse the repository at this point in the history
  • Loading branch information
fathzer committed Apr 5, 2024
1 parent 04aeda8 commit 8726b02
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/main/java/com/fathzer/jchess/uci/extended/ExtendedUCI.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@ protected void doDisplay(Deque<String> tokens) {
debug(NO_POSITION_DEFINED);
return;
}
if (! (engine instanceof Displayable)) {
debug("position display is not supported by this engine");
}
//FIXME Engine could be non displayable here
final String result;
if (tokens.isEmpty()) {
result = ((Displayable)getEngine()).getBoardAsString();
} else if (tokens.size()==1 && "fen".equals(tokens.peek())) {
result = ((Displayable)getEngine()).getFEN();
if (engine instanceof Displayable displayable) {
final String result;
if (tokens.isEmpty()) {
result = displayable.getBoardAsString();
} else if (tokens.size()==1 && "fen".equals(tokens.peek())) {
result = ((Displayable)getEngine()).getFEN();
} else {
debug("Unknown display options "+Arrays.asList(tokens));
return;
}
out(result);
} else {
debug("Unknown display options "+Arrays.asList(tokens));
return;
debug("position display is not supported by this engine");
}
out(result);
}

protected <M> void doPerft(Deque<String> tokens) {
Expand Down

0 comments on commit 8726b02

Please sign in to comment.