summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/control')
-rw-r--r--src/jrummikub/control/SettingsControl.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/jrummikub/control/SettingsControl.java b/src/jrummikub/control/SettingsControl.java
index dfaa552..ffd1911 100644
--- a/src/jrummikub/control/SettingsControl.java
+++ b/src/jrummikub/control/SettingsControl.java
@@ -4,6 +4,8 @@ import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
+import jrummikub.control.turn.TurnControlFactory;
+import jrummikub.control.turn.TurnControlFactory.Type;
import jrummikub.model.GameSettings;
import jrummikub.model.PlayerSettings;
import jrummikub.util.Connection;
@@ -118,6 +120,13 @@ public class SettingsControl {
setPlayerName(i, name);
}
}));
+ connections.add(view.getSettingsPanel().getChangePlayerTypeEvent()
+ .add(new IListener2<Integer, TurnControlFactory.Type>() {
+ @Override
+ public void handle(Integer i, TurnControlFactory.Type type) {
+ setPlayerType(i, type);
+ }
+ }));
}
private void addPlayer() {
@@ -186,6 +195,11 @@ public class SettingsControl {
update();
}
+ private void setPlayerType(Integer i, Type type) {
+ settings.getPlayerList().get(i).setTurnControlType(type);
+ update();
+ }
+
private void update() {
view.getSettingsPanel().enableRemovePlayerButtons(
settings.getPlayerList().size() > 2);