Added test and implementation for an inspection turn before the first

turn

git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@273 72836036-5685-4462-b002-a69064685172
This commit is contained in:
Jannis Harder 2011-05-25 17:10:43 +02:00
parent 157bd4f606
commit a1c0cb89f6
7 changed files with 140 additions and 19 deletions

View file

@ -94,4 +94,18 @@ public interface IRoundState {
*/
public void setActivePlayerNumber(int i);
/**
* Gets the number of the current turn. Numbers smaller than one indicate
* hand inspection turns
*
* @return current turn number
*/
public abstract int getTurnNumber();
/**
* Increments the turn number
*
*/
public void nextTurn();
}

View file

@ -12,6 +12,7 @@ public class RoundState implements IRoundState {
private int activePlayer;
private StoneHeap gameHeap;
private IPlayer lastPlayer;
private int turnNumber;
/**
* Create a new RoundState with an empty table
@ -29,6 +30,8 @@ public class RoundState implements IRoundState {
players.add(new Player(playerSettings, gameSettings));
}
turnNumber = 1-gameSettings.getPlayerList().size();
activePlayer = 0;
gameHeap = new StoneHeap();
}
@ -104,4 +107,14 @@ public class RoundState implements IRoundState {
public IPlayer getLastPlayer() {
return lastPlayer;
}
@Override
public int getTurnNumber() {
return turnNumber;
}
@Override
public void nextTurn() {
turnNumber++;
}
}