diff options
author | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-24 01:51:54 +0200 |
---|---|---|
committer | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-24 01:51:54 +0200 |
commit | 92d110995488380778bd378f4297032a325dc385 (patch) | |
tree | 38bc26c6228a588b160bc0b053768044791dcaa4 /mock/jrummikub | |
parent | d9a0b0e37dbdde6d60fa4ee41c2a100547e7824b (diff) | |
download | JRummikub-92d110995488380778bd378f4297032a325dc385.tar JRummikub-92d110995488380778bd378f4297032a325dc385.zip |
Select a random player for the first round
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@263 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'mock/jrummikub')
-rw-r--r-- | mock/jrummikub/model/MockRoundState.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mock/jrummikub/model/MockRoundState.java b/mock/jrummikub/model/MockRoundState.java index 32fce33..0341f27 100644 --- a/mock/jrummikub/model/MockRoundState.java +++ b/mock/jrummikub/model/MockRoundState.java @@ -91,4 +91,13 @@ public class MockRoundState implements IRoundState { public void setLastPlayer(IPlayer lastPlayer) { this.lastPlayer = lastPlayer; } + + @Override + public void setActivePlayerNumber(int i) { + int j = i % players.size(); + if (j < 0) { + j += players.size(); + } + activePlayer = j; + } } |