From d6c4da62243310b85a82e73e55249de9af7fdb11 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 22 Jun 2011 03:08:37 +0200 Subject: Show in start turn panel if a player has redealed or drawn the last stone git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@570 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/model/GameState.java | 26 ++++++++++++++++++++++++-- src/jrummikub/model/IRoundState.java | 2 +- src/jrummikub/model/RoundState.java | 8 ++++---- 3 files changed, 29 insertions(+), 7 deletions(-) (limited to 'src/jrummikub/model') 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 scores = new ArrayList(); + private PlayerSettings lastPlayerRedealed; /** * Gets the number of the first player of the first round @@ -33,6 +34,25 @@ public class GameState implements Serializable { this.firstRoundFirstPlayer = firstRoundFirstPlayer; } + /** + * 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 * @@ -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 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 -- cgit v1.2.3