Score increments when the player places a tile, also increments without the visible delay.

This commit is contained in:
Woody Folsom
2012-04-29 15:39:47 -04:00
parent 20f172c95a
commit c06f7ab38e
2 changed files with 4 additions and 5 deletions

View File

@@ -62,7 +62,7 @@ public class Board {
} }
public int getTurn() { public int getTurn() {
return numPlies / 2; return (numPlies + 1)/ 2;
} }
@Override @Override

View File

@@ -150,7 +150,6 @@ public class Referee implements Runnable {
private void play() { private void play() {
int plies = 0; int plies = 0;
while (!isOver()) { while (!isOver()) {
getScorePanel().updateScore(getPlayerScore());
if (board.isPlayerTurn()) { if (board.isPlayerTurn()) {
boolean wasInterrupted = false; boolean wasInterrupted = false;
while (!humanPlayer.isReady()) { while (!humanPlayer.isReady()) {
@@ -189,12 +188,12 @@ public class Referee implements Runnable {
// random, meaningless data. // random, meaningless data.
// getPlayerModel().getOutputNodes(getBoardState(board)); // getPlayerModel().getOutputNodes(getBoardState(board));
} }
getScorePanel().updateScore(getPlayerScore());
mf.updateMessage(getMessage()); mf.updateMessage(getMessage());
boardPanel.updateIcons(); boardPanel.updateIcons();
LOGGER.info("plies: " + plies++); LOGGER.info("plies: " + plies++);
try { try {
Thread.sleep(1000L); Thread.sleep(250L);
} catch (InterruptedException ie) { } catch (InterruptedException ie) {
System.out System.out
.println("Interrupted while waiting for human view ply!"); .println("Interrupted while waiting for human view ply!");