Skip to content

Commit

Permalink
Correct inconsistent indents etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiraoka committed Jan 30, 2021
1 parent 6273aff commit c448a30
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/main/java/featurecat/lizzie/rules/SGFParser.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package featurecat.lizzie.rules;

import static java.util.Arrays.asList;

import featurecat.lizzie.Lizzie;
import featurecat.lizzie.analysis.GameInfo;
import featurecat.lizzie.analysis.Leelaz;
import featurecat.lizzie.util.EncodingDetector;
import featurecat.lizzie.util.Utils;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
Expand All @@ -21,8 +22,6 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import static java.util.Arrays.asList;

public class SGFParser {
private static final SimpleDateFormat SGF_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd");

Expand Down Expand Up @@ -434,11 +433,11 @@ private static BoardHistoryList parseValue(
// Save the step count
subTreeStepMap.put(subTreeDepth, subTreeStepMap.get(subTreeDepth) + 1);
Stone color =
((history == null
((history == null
&& Lizzie.board.getHistory().getLastMoveColor() == Stone.WHITE)
|| (history != null && history.getLastMoveColor() == Stone.WHITE))
? Stone.BLACK
: Stone.WHITE;
|| (history != null && history.getLastMoveColor() == Stone.WHITE))
? Stone.BLACK
: Stone.WHITE;
boolean newBranch = (subTreeStepMap.get(subTreeDepth) == 1);
if (history == null) {
Lizzie.board.pass(color, newBranch, true);
Expand All @@ -463,10 +462,10 @@ private static BoardHistoryList parseValue(
if (move != null) {
if (history == null) {
Lizzie.board.removeStone(
move[0], move[1], tag.equals("AB") ? Stone.BLACK : Stone.WHITE);
move[0], move[1], tag.equals("AB") ? Stone.BLACK : Stone.WHITE);
} else {
history.removeStone(
move[0], move[1], tag.equals("AB") ? Stone.BLACK : Stone.WHITE);
move[0], move[1], tag.equals("AB") ? Stone.BLACK : Stone.WHITE);
}
}
} else {
Expand Down Expand Up @@ -506,7 +505,7 @@ private static BoardHistoryList parseValue(
}
}

//adjust player name
// adjust player name
if (!Utils.isBlank(blackPlayerRank)) {
blackPlayer = blackPlayer + " " + blackPlayerRank;
if (history == null) {
Expand All @@ -530,7 +529,7 @@ private static BoardHistoryList parseValue(
Lizzie.frame.setPlayers(whitePlayer, blackPlayer);
if (history == null) {
if (!Utils.isBlank(gameProperties.get("RE"))
&& Utils.isBlank(Lizzie.board.getHistory().getData().comment)) {
&& Utils.isBlank(Lizzie.board.getHistory().getData().comment)) {
Lizzie.board.getHistory().getData().comment = gameProperties.get("RE");
}

Expand Down

0 comments on commit c448a30

Please sign in to comment.