From 92d110995488380778bd378f4297032a325dc385 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Tue, 24 May 2011 01:51:54 +0200 Subject: 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 --- mock/jrummikub/model/MockRoundState.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mock/jrummikub') 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; + } } -- cgit v1.2.3