summaryrefslogtreecommitdiffstats
path: root/mock
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-05-18 17:01:10 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-05-18 17:01:10 +0200
commitb5397d5aa7f01d557a469ca0d70f3b33e1fe2c60 (patch)
tree899de9a3f0e71718ecf8f6018e2b8c347b3b93df /mock
parent5169f31af06926f4c268062791f648f1fdd91656 (diff)
downloadJRummikub-b5397d5aa7f01d557a469ca0d70f3b33e1fe2c60.tar
JRummikub-b5397d5aa7f01d557a469ca0d70f3b33e1fe2c60.zip
Move some static player data to a player settings class
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@252 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'mock')
-rw-r--r--mock/jrummikub/model/MockPlayer.java26
-rw-r--r--mock/jrummikub/model/MockRoundState.java8
2 files changed, 11 insertions, 23 deletions
diff --git a/mock/jrummikub/model/MockPlayer.java b/mock/jrummikub/model/MockPlayer.java
index a6dfe01..a580a48 100644
--- a/mock/jrummikub/model/MockPlayer.java
+++ b/mock/jrummikub/model/MockPlayer.java
@@ -1,7 +1,5 @@
package jrummikub.model;
-import java.awt.Color;
-
/**
* Mock class for {@link Player}
*/
@@ -9,22 +7,17 @@ public class MockPlayer implements IPlayer {
/** */
public Hand hand;
/** */
- public String name;
- /** */
- public Color color;
+ public PlayerSettings playerSettings;
/** */
public boolean laidOut;
/**
- * @param name
- * the player name
- * @param color
- * the player color
+ * @param playerSettings
+ * the player settings
*/
- public MockPlayer(String name, Color color) {
+ public MockPlayer(PlayerSettings playerSettings) {
hand = new Hand();
- this.name = name;
- this.color = color;
+ this.playerSettings = playerSettings;
laidOut = false;
}
@@ -39,12 +32,7 @@ public class MockPlayer implements IPlayer {
}
@Override
- public Color getColor() {
- return color;
- }
-
- @Override
- public String getName() {
- return name;
+ public PlayerSettings getPlayerSettings() {
+ return playerSettings;
}
}
diff --git a/mock/jrummikub/model/MockRoundState.java b/mock/jrummikub/model/MockRoundState.java
index b7ec1eb..7b58fab 100644
--- a/mock/jrummikub/model/MockRoundState.java
+++ b/mock/jrummikub/model/MockRoundState.java
@@ -25,10 +25,10 @@ public class MockRoundState implements IRoundState {
public MockRoundState() {
table = new MockTable();
players = new ArrayList<MockPlayer>();
- players.add(new MockPlayer("Player 1", Color.RED));
- players.add(new MockPlayer("Player 2", Color.YELLOW));
- players.add(new MockPlayer("Player 3", Color.GREEN));
- players.add(new MockPlayer("Player 4", Color.BLACK));
+ players.add(new MockPlayer(new PlayerSettings("Player 1", Color.RED)));
+ players.add(new MockPlayer(new PlayerSettings("Player 2", Color.YELLOW)));
+ players.add(new MockPlayer(new PlayerSettings("Player 3", Color.GREEN)));
+ players.add(new MockPlayer(new PlayerSettings("Player 4", Color.BLACK)));
activePlayer = 0;
gameHeap = new StoneHeap();
gameSettings = new GameSettings();