(Color newColor, int newPieces)
| 109 | } |
| 110 | |
| 111 | public void updateScore(Color newColor, int newPieces) { |
| 112 | /* If we added x pieces of a color, then we actually removed x - 1 pieces of the other |
| 113 | * color. The -1 is because one of the new pieces was the just-placed one. |
| 114 | */ |
| 115 | if (newColor == Color.Black) { |
| 116 | whiteCount -= newPieces - 1; |
| 117 | blackCount += newPieces; |
| 118 | } else { |
| 119 | blackCount -= newPieces - 1; |
| 120 | whiteCount += newPieces; |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | public void printBoard() { |
| 125 | for (int r = 0; r < board.length; r++) { |