From fcf33eb280d64b0ce376f7fa10d508c153b2ada9 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 20 Jun 2011 00:40:55 +0200 Subject: Add client side to NetworkRoundControl test and implementation git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@498 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/control/RoundControl.java | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/jrummikub/control/RoundControl.java') diff --git a/src/jrummikub/control/RoundControl.java b/src/jrummikub/control/RoundControl.java index 285980a..8dbf236 100644 --- a/src/jrummikub/control/RoundControl.java +++ b/src/jrummikub/control/RoundControl.java @@ -81,7 +81,10 @@ public class RoundControl { * Begin the round */ public void startRound() { - deal(); + if (roundState != null) { + deal(); + } + continueRound(); } @@ -103,7 +106,9 @@ public class RoundControl { } })); - prepareTurn(); + if (roundState != null) { + prepareTurn(); + } } /** @@ -117,11 +122,16 @@ public class RoundControl { } } + protected void setRoundState(IRoundState state) { + roundState = state; + roundStateUpdateEvent.emit(state); + } + protected void prepareTurn() { doPrepareTurn(); boolean isHuman = roundState.getActivePlayer().getPlayerSettings() - .getType() == HUMAN; + .getType() == HUMAN; boolean oneHuman = roundState.getGameSettings().oneHuman(); boolean isAI = (turnControl instanceof AIControl); @@ -157,6 +167,10 @@ public class RoundControl { } protected void startTurn() { + if (turnControl == null) { + doPrepareTurn(); + } + boolean isHuman = roundState.getActivePlayer().getPlayerSettings() .getType() == HUMAN; -- cgit v1.2.3