diff options
Diffstat (limited to 'src/jrummikub')
-rw-r--r-- | src/jrummikub/JRummikub.java | 3 | ||||
-rw-r--r-- | src/jrummikub/control/GameControl.java | 6 | ||||
-rw-r--r-- | src/jrummikub/model/GameSettings.java | 24 | ||||
-rw-r--r-- | src/jrummikub/model/IGameSettings.java | 29 | ||||
-rw-r--r-- | src/jrummikub/model/IRoundState.java | 2 | ||||
-rw-r--r-- | src/jrummikub/model/RoundState.java | 6 |
6 files changed, 22 insertions, 48 deletions
diff --git a/src/jrummikub/JRummikub.java b/src/jrummikub/JRummikub.java index 04dea53..9c22dc6 100644 --- a/src/jrummikub/JRummikub.java +++ b/src/jrummikub/JRummikub.java @@ -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)); diff --git a/src/jrummikub/control/GameControl.java b/src/jrummikub/control/GameControl.java index efc0c57..b5d763a 100644 --- a/src/jrummikub/control/GameControl.java +++ b/src/jrummikub/control/GameControl.java @@ -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; diff --git a/src/jrummikub/model/GameSettings.java b/src/jrummikub/model/GameSettings.java index 8ace0fb..b5079d4 100644 --- a/src/jrummikub/model/GameSettings.java +++ b/src/jrummikub/model/GameSettings.java @@ -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; } diff --git a/src/jrummikub/model/IGameSettings.java b/src/jrummikub/model/IGameSettings.java deleted file mode 100644 index 68e801a..0000000 --- a/src/jrummikub/model/IGameSettings.java +++ /dev/null @@ -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(); - -}
\ No newline at end of file diff --git a/src/jrummikub/model/IRoundState.java b/src/jrummikub/model/IRoundState.java index aba27af..af7a478 100644 --- a/src/jrummikub/model/IRoundState.java +++ b/src/jrummikub/model/IRoundState.java @@ -10,7 +10,7 @@ public interface IRoundState { * * @return The game settings */ - public IGameSettings getGameSettings(); + public GameSettings getGameSettings(); /** * Get the current {@link Table} diff --git a/src/jrummikub/model/RoundState.java b/src/jrummikub/model/RoundState.java index 63b72ea..56f7904 100644 --- a/src/jrummikub/model/RoundState.java +++ b/src/jrummikub/model/RoundState.java @@ -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; } } |