From 5029ff206a00695bb955e49d659c20b8313192d4 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Fri, 27 May 2011 18:55:19 +0200 Subject: Checking whether redealing is allowed git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@290 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/control/RoundControl.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/jrummikub/control') diff --git a/src/jrummikub/control/RoundControl.java b/src/jrummikub/control/RoundControl.java index 8aed1ce..413211a 100644 --- a/src/jrummikub/control/RoundControl.java +++ b/src/jrummikub/control/RoundControl.java @@ -69,8 +69,6 @@ public class RoundControl { startTurn(); } })); - - prepareTurn(); } @@ -81,11 +79,19 @@ public class RoundControl { view.getTablePanel().setStoneSets(clonedTable); view.setCurrentPlayerName(roundState.getActivePlayer() .getPlayerSettings().getName()); + } private void startTurn() { + boolean inspectOnly = roundState.getTurnNumber() < 1; + boolean mayRedeal = inspectOnly + && roundState.getActivePlayer().getHand() + .getIdenticalStoneCount() >= 3; + + view.getPlayerPanel().setEndTurnMode(inspectOnly, mayRedeal); + TurnControl turnControl = new TurnControl(roundState.getActivePlayer() - .getHand(), clonedTable, view, roundState.getTurnNumber() < 1); + .getHand(), clonedTable, view, inspectOnly); turnControl.getEndOfTurnEvent().add(new IListener() { @Override @@ -93,7 +99,7 @@ public class RoundControl { endOfTurn(); } }); - + turnControl.getRedealEvent().add(new IListener() { @Override public void handle() { -- cgit v1.2.3