summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control
diff options
context:
space:
mode:
authorIda Massow <massow@informatik.uni-luebeck.de>2011-05-31 00:58:46 +0200
committerIda Massow <massow@informatik.uni-luebeck.de>2011-05-31 00:58:46 +0200
commitf22ff5f0f1d8f9838c30943bde658ca3f282bbc8 (patch)
tree4e3a34af00086ca862345c4677e69aaed04f3e49 /src/jrummikub/control
parentd66d73ea8f9d660d14e3ef80e716ac1628704fe4 (diff)
downloadJRummikub-f22ff5f0f1d8f9838c30943bde658ca3f282bbc8.tar
JRummikub-f22ff5f0f1d8f9838c30943bde658ca3f282bbc8.zip
Tests für Sets mit mehr Farben, mehr Values, ...
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@332 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/control')
-rw-r--r--src/jrummikub/control/RoundControl.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/jrummikub/control/RoundControl.java b/src/jrummikub/control/RoundControl.java
index 5874532..e04327f 100644
--- a/src/jrummikub/control/RoundControl.java
+++ b/src/jrummikub/control/RoundControl.java
@@ -78,22 +78,23 @@ public class RoundControl {
}
private void prepareTurn() {
- boolean isHuman = roundState.getActivePlayer().getPlayerSettings().getTurnControlType() == HUMAN;
+ boolean isHuman = roundState.getActivePlayer().getPlayerSettings()
+ .getTurnControlType() == HUMAN;
clonedTable = (ITable) roundState.getTable().clone();
-
+
if (isHuman) {
view.enableStartTurnPanel(true);
} else {
view.enableThinkPanel(true);
}
-
+
view.getTablePanel().setStoneSets(clonedTable);
view.setCurrentPlayerName(roundState.getActivePlayer()
.getPlayerSettings().getName());
view.setCurrentPlayerColor(roundState.getActivePlayer()
.getPlayerSettings().getColor());
view.setHasLaidOut(roundState.getActivePlayer().getLaidOut());
-
+
if (!isHuman)
startTurn();
}
@@ -101,7 +102,8 @@ public class RoundControl {
private void startTurn() {
if (turnControl != null)
return;
- boolean isHuman = roundState.getActivePlayer().getPlayerSettings().getTurnControlType() == HUMAN;
+ boolean isHuman = roundState.getActivePlayer().getPlayerSettings()
+ .getTurnControlType() == HUMAN;
boolean inspectOnly = roundState.getTurnNumber() < 1;
boolean mayRedeal = inspectOnly
&& roundState.getActivePlayer().getHand()
@@ -110,10 +112,11 @@ public class RoundControl {
if (isHuman) {
view.getPlayerPanel().setEndTurnMode(inspectOnly, mayRedeal);
}
- turnControl = TurnControlFactory.getFactory(roundState.getActivePlayer()
- .getPlayerSettings().getTurnControlType()).create();
- turnControl.setup(roundState.getActivePlayer(), clonedTable,
- view, inspectOnly, mayRedeal);
+ turnControl = TurnControlFactory.getFactory(
+ roundState.getActivePlayer().getPlayerSettings()
+ .getTurnControlType()).create();
+ turnControl.setup(roundState.getActivePlayer(), clonedTable, view,
+ inspectOnly, mayRedeal);
turnControl.getEndOfTurnEvent().add(new IListener() {
@Override
public void handle() {
@@ -148,7 +151,8 @@ public class RoundControl {
int totalValue = 0;
for (StoneSet set : newSets) {
- totalValue += set.classify().getSecond();
+ totalValue += set.classify(roundState.getGameSettings())
+ .getSecond();
}
return totalValue == 0