summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control
diff options
context:
space:
mode:
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