diff options
author | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-24 01:51:53 +0200 |
---|---|---|
committer | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-24 01:51:53 +0200 |
commit | d9a0b0e37dbdde6d60fa4ee41c2a100547e7824b (patch) | |
tree | 3d711c9b7d75ebdda72966d7cfaf72d92fe12216 /mock/jrummikub/model | |
parent | b20961b89dd07be5ac2ff3b7fd1132eca0944ac4 (diff) | |
download | JRummikub-d9a0b0e37dbdde6d60fa4ee41c2a100547e7824b.tar JRummikub-d9a0b0e37dbdde6d60fa4ee41c2a100547e7824b.zip |
Implemented special case round end (heap empty)
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@262 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'mock/jrummikub/model')
-rw-r--r-- | mock/jrummikub/model/MockRoundState.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/mock/jrummikub/model/MockRoundState.java b/mock/jrummikub/model/MockRoundState.java index 5f478fb..32fce33 100644 --- a/mock/jrummikub/model/MockRoundState.java +++ b/mock/jrummikub/model/MockRoundState.java @@ -20,7 +20,9 @@ public class MockRoundState implements IRoundState { public StoneHeap gameHeap; /** */ public GameSettings gameSettings; - + /** */ + public IPlayer lastPlayer; + /** */ public MockRoundState() { table = new MockTable(); @@ -63,7 +65,11 @@ public class MockRoundState implements IRoundState { @Override public IPlayer getNthNextPlayer(int i) { - return players.get((activePlayer + i) % players.size()); + int j = (activePlayer + i) % players.size(); + if (j < 0) { + j += players.size(); + } + return players.get(j); } @Override @@ -75,4 +81,14 @@ public class MockRoundState implements IRoundState { public GameSettings getGameSettings() { return gameSettings; } + + @Override + public IPlayer getLastPlayer() { + return lastPlayer; + } + + @Override + public void setLastPlayer(IPlayer lastPlayer) { + this.lastPlayer = lastPlayer; + } } |