diff options
Diffstat (limited to 'mock')
-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; + } } |