diff options
author | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-27 18:55:19 +0200 |
---|---|---|
committer | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-05-27 18:55:19 +0200 |
commit | 5029ff206a00695bb955e49d659c20b8313192d4 (patch) | |
tree | 2770fdde17fc9f8e7a98a1c7dc9dc8158c05f1ab | |
parent | ffeefad2579232c6057b383d75a9df4517f83aa6 (diff) | |
download | JRummikub-5029ff206a00695bb955e49d659c20b8313192d4.tar JRummikub-5029ff206a00695bb955e49d659c20b8313192d4.zip |
Checking whether redealing is allowed
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@290 72836036-5685-4462-b002-a69064685172
-rw-r--r-- | src/jrummikub/control/RoundControl.java | 14 |
1 files changed, 10 insertions, 4 deletions
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() { |