Skip to content

Commit

Permalink
fixed: Display latest stone for ghost dead stone (#401)
Browse files Browse the repository at this point in the history
Display latest stone for ghost dead stone
  • Loading branch information
zsalch authored Nov 3, 2018
1 parent a066f38 commit 84d8709
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/featurecat/lizzie/gui/BoardRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,17 @@ private void drawBranch() {

for (int i = 0; i < Board.boardSize; i++) {
for (int j = 0; j < Board.boardSize; j++) {
if (Lizzie.board.getData().stones[Board.getIndex(i, j)] != Stone.EMPTY) continue;
if (branch.data.moveNumberList[Board.getIndex(i, j)] > maxBranchMoves()) continue;
// Display latest stone for ghost dead stone
int index = Board.getIndex(i, j);
Stone stone = branch.data.stones[index];
boolean isGhost = (stone == Stone.BLACK_GHOST || stone == Stone.WHITE_GHOST);
if (Lizzie.board.getData().stones[index] != Stone.EMPTY && !isGhost) continue;
if (branch.data.moveNumberList[index] > maxBranchMoves()) continue;

int stoneX = scaledMargin + squareLength * i;
int stoneY = scaledMargin + squareLength * j;

drawStone(
g, gShadow, stoneX, stoneY, branch.data.stones[Board.getIndex(i, j)].unGhosted(), i, j);
drawStone(g, gShadow, stoneX, stoneY, stone.unGhosted(), i, j);
}
}

Expand Down

0 comments on commit 84d8709

Please sign in to comment.