diff options
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; } |