diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-22 03:08:37 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-06-22 03:08:37 +0200 |
commit | d6c4da62243310b85a82e73e55249de9af7fdb11 (patch) | |
tree | ecdb215533c41a9d6f02c0770ea76a38f8b4867b /src/jrummikub/model | |
parent | 62a55c0a918b1d91338a68ee89211006e11785bf (diff) | |
download | JRummikub-d6c4da62243310b85a82e73e55249de9af7fdb11.tar JRummikub-d6c4da62243310b85a82e73e55249de9af7fdb11.zip |
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
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 |