diff options
author | Ida Massow <massow@informatik.uni-luebeck.de> | 2011-05-04 23:26:01 +0200 |
---|---|---|
committer | Ida Massow <massow@informatik.uni-luebeck.de> | 2011-05-04 23:26:01 +0200 |
commit | e2f82f3f28a0872ed626439809a292e701c9b01e (patch) | |
tree | 30ad0cd035cd204ed26291f19fd1244a1e8b47ce /src/jrummikub/model | |
parent | db7489a5c78551e4db52acd11656f2b872740f89 (diff) | |
download | JRummikub-e2f82f3f28a0872ed626439809a292e701c9b01e.tar JRummikub-e2f82f3f28a0872ed626439809a292e701c9b01e.zip |
Test für RoundControl fertig
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@128 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/model')
-rw-r--r-- | src/jrummikub/model/GameState.java | 12 | ||||
-rw-r--r-- | src/jrummikub/model/Player.java | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/jrummikub/model/GameState.java b/src/jrummikub/model/GameState.java index e1bd6f3..0e43a9c 100644 --- a/src/jrummikub/model/GameState.java +++ b/src/jrummikub/model/GameState.java @@ -5,7 +5,7 @@ import java.util.ArrayList; import java.util.List; /** Class managing the overall and momentary GameState */ -public class GameState { +public class GameState implements IGameState { private ITable table; private List<Player> players; private int activePlayer; @@ -22,27 +22,33 @@ public class GameState { gameHeap = new StoneHeap(); } + @Override public ITable getTable() { return table; } + @Override public int getPlayerCount() { return players.size(); } - public Player getPlayer(int i) { + @Override + public IPlayer getPlayer(int i) { return players.get(i); } /** Changes the activePlayer to the next {@link Player} in the list */ + @Override public void nextPlayer() { activePlayer = (activePlayer + 1) % players.size(); } - public Player getActivePlayer() { + @Override + public IPlayer getActivePlayer() { return players.get(activePlayer); } + @Override public StoneHeap getGameHeap() { return gameHeap; } diff --git a/src/jrummikub/model/Player.java b/src/jrummikub/model/Player.java index 50a525a..d5bda32 100644 --- a/src/jrummikub/model/Player.java +++ b/src/jrummikub/model/Player.java @@ -3,7 +3,7 @@ package jrummikub.model; import java.awt.Color; /** Class managing player data. No methods in release 1 */ -public class Player { +public class Player implements IPlayer { private IHand hand; private Color color; @@ -15,10 +15,12 @@ public class Player { this.color = color; } + @Override public IHand getHand() { return hand; } + @Override public Color getColor() { return color; } |