Cleaned up RoundControl tests

git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@260 72836036-5685-4462-b002-a69064685172
This commit is contained in:
Jannis Harder 2011-05-24 01:51:49 +02:00
parent 102299d0ff
commit 2446671f7a
10 changed files with 45 additions and 105 deletions

View file

@ -6,7 +6,6 @@ import javax.swing.UIManager;
import jrummikub.control.GameControl;
import jrummikub.model.GameSettings;
import jrummikub.model.IGameSettings;
import jrummikub.model.PlayerSettings;
import jrummikub.view.impl.View;
@ -29,7 +28,7 @@ public class JRummikub {
} catch (Exception e) {
}
IGameSettings gameSettings = new GameSettings();
GameSettings gameSettings = new GameSettings();
gameSettings.getPlayerList().add(new PlayerSettings("Ida", Color.RED));
gameSettings.getPlayerList().add(
new PlayerSettings("Matthias", Color.YELLOW));

View file

@ -1,6 +1,6 @@
package jrummikub.control;
import jrummikub.model.IGameSettings;
import jrummikub.model.GameSettings;
import jrummikub.model.RoundState;
import jrummikub.util.IListener;
import jrummikub.view.IView;
@ -9,7 +9,7 @@ import jrummikub.view.IView;
* Controls a Game, at some point including all Rounds, starts new Rounds
*/
public class GameControl {
private IGameSettings gameSettings;
private GameSettings gameSettings;
private IView view;
private RoundControl roundControl;
@ -21,7 +21,7 @@ public class GameControl {
* @param view
* the view
*/
public GameControl(IGameSettings gameSettings, IView view) {
public GameControl(GameSettings gameSettings, IView view) {
this.gameSettings = gameSettings;
this.view = view;

View file

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

View file

@ -1,29 +0,0 @@
package jrummikub.model;
import java.util.List;
public interface IGameSettings {
/**
* Returns the list containing the settings of all players
*
* @return the player settings list
*/
public List<PlayerSettings> getPlayerList();
/**
* Sets the initial meld threshold
*
* @param value
* the value to set
*/
public void setInitialMeldThreshold(int value);
/**
* Returns the initial meld threshold
*
* @return the threshold
*/
public int getInitialMeldThreshold();
}

View file

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

View file

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