diff options
Diffstat (limited to 'src/jrummikub/model')
-rw-r--r-- | src/jrummikub/model/GameState.java | 26 | ||||
-rw-r--r-- | src/jrummikub/model/IRoundState.java | 2 | ||||
-rw-r--r-- | src/jrummikub/model/RoundState.java | 8 |
3 files changed, 29 insertions, 7 deletions
diff --git a/src/jrummikub/model/GameState.java b/src/jrummikub/model/GameState.java index ee5c2d3..7cd38ab 100644 --- a/src/jrummikub/model/GameState.java +++ b/src/jrummikub/model/GameState.java @@ -13,6 +13,7 @@ public class GameState implements Serializable { private int firstRoundFirstPlayer; private ArrayList<Score> scores = new ArrayList<Score>(); + private PlayerSettings lastPlayerRedealed; /** * Gets the number of the first player of the first round @@ -34,6 +35,25 @@ public class GameState implements Serializable { } /** + * Sets the player that has redealed last + * + * @param lastPlayerRedealed + * the player to set + */ + public void setLastPlayerRedealed(PlayerSettings lastPlayerRedealed) { + this.lastPlayerRedealed = lastPlayerRedealed; + } + + /** + * Returns the player that has redealed last + * + * @return the player + */ + public PlayerSettings getLastPlayerRedealed() { + return lastPlayerRedealed; + } + + /** * Returns the list of players' scores in the rounds played before * * @return the list of scores @@ -45,8 +65,10 @@ public class GameState implements Serializable { /** * Returns whether players have won * - * @param points the player's points - * @param wins the number of wins per player + * @param points + * the player's points + * @param wins + * the number of wins per player * @return whether a player has won */ private Boolean[] getWinners(Integer[] points, int[] wins) { diff --git a/src/jrummikub/model/IRoundState.java b/src/jrummikub/model/IRoundState.java index 6d43f02..3eedc4c 100644 --- a/src/jrummikub/model/IRoundState.java +++ b/src/jrummikub/model/IRoundState.java @@ -51,7 +51,7 @@ public interface IRoundState extends Serializable { * * @return heap of stones */ - public StoneHeap getGameHeap(); + public StoneHeap getStoneHeap(); /** * Returns the player that would be the active player after i turns diff --git a/src/jrummikub/model/RoundState.java b/src/jrummikub/model/RoundState.java index 04a977d..f7a75d5 100644 --- a/src/jrummikub/model/RoundState.java +++ b/src/jrummikub/model/RoundState.java @@ -12,7 +12,7 @@ public class RoundState implements IRoundState { private ITable table; private ArrayList<Player> players; private int activePlayer; - private StoneHeap gameHeap; + private StoneHeap stoneHeap; private IPlayer lastPlayer; private int turnNumber; @@ -38,7 +38,7 @@ public class RoundState implements IRoundState { turnNumber = 1 - gameSettings.getPlayerList().size(); activePlayer = 0; - gameHeap = new StoneHeap(gameSettings); + stoneHeap = new StoneHeap(gameSettings); } @Override @@ -94,8 +94,8 @@ public class RoundState implements IRoundState { } @Override - public StoneHeap getGameHeap() { - return gameHeap; + public StoneHeap getStoneHeap() { + return stoneHeap; } @Override |