Rauskommen fertig und getestet

git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@256 72836036-5685-4462-b002-a69064685172
This commit is contained in:
Ida Massow 2011-05-21 15:51:36 +02:00
parent cb3f9cc011
commit 7354002de5
13 changed files with 324 additions and 181 deletions

View file

@ -6,7 +6,7 @@ import java.util.List;
/**
* The overall game settings
*/
public class GameSettings {
public class GameSettings implements IGameSettings {
private List<PlayerSettings> players = new ArrayList<PlayerSettings>();
private int initialMeldThreshold;
@ -18,30 +18,26 @@ public class GameSettings {
initialMeldThreshold = 30;
}
/**
* Returns the list containing the settings of all players
*
* @return the player settings list
/* (non-Javadoc)
* @see jrummikub.model.IGameSettings#getPlayerList()
*/
@Override
public List<PlayerSettings> getPlayerList() {
return players;
}
/**
* Sets the initial meld threshold
*
* @param value
* the value to set
/* (non-Javadoc)
* @see jrummikub.model.IGameSettings#setInitialMeldThreshold(int)
*/
@Override
public void setInitialMeldThreshold(int value) {
initialMeldThreshold = value;
}
/**
* Returns the initial meld threshold
*
* @return the threshold
/* (non-Javadoc)
* @see jrummikub.model.IGameSettings#getInitialMeldThreshold()
*/
@Override
public int getInitialMeldThreshold() {
return initialMeldThreshold;
}

View file

@ -25,4 +25,10 @@ public interface IPlayer {
* @return the player settings
*/
public PlayerSettings getPlayerSettings();
/**
* Set if the player laid out
*
*/
void setLaidOut(boolean laidOut);
}

View file

@ -10,7 +10,7 @@ public interface IRoundState {
*
* @return The game settings
*/
public GameSettings getGameSettings();
public IGameSettings getGameSettings();
/**
* Get the current {@link Table}

View file

@ -10,7 +10,7 @@ public class Player implements IPlayer {
* Create a new player with a given name and color
*
* @param settings
* the player settings
* the player settings
*/
public Player(PlayerSettings settings) {
this.settings = settings;
@ -29,6 +29,11 @@ public class Player implements IPlayer {
return laidOut;
}
@Override
public void setLaidOut(boolean laidOut) {
this.laidOut = laidOut;
}
@Override
public PlayerSettings getPlayerSettings() {
return settings;

View file

@ -5,7 +5,7 @@ import java.util.List;
/** Class managing the overall and momentary RoundState */
public class RoundState implements IRoundState {
private GameSettings gameSettings;
private IGameSettings gameSettings;
private ITable table;
private List<Player> players;
@ -18,7 +18,7 @@ public class RoundState implements IRoundState {
* @param gameSettings
* the game settings
*/
public RoundState(GameSettings gameSettings) {
public RoundState(IGameSettings gameSettings) {
this.gameSettings = gameSettings;
table = new Table();
@ -68,7 +68,7 @@ public class RoundState implements IRoundState {
}
@Override
public GameSettings getGameSettings() {
public IGameSettings getGameSettings() {
return gameSettings;
}
}