summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control
diff options
context:
space:
mode:
Diffstat (limited to 'src/jrummikub/control')
-rw-r--r--src/jrummikub/control/SettingsControl.java7
-rw-r--r--src/jrummikub/control/network/NetworkSettingsControl.java4
2 files changed, 11 insertions, 0 deletions
diff --git a/src/jrummikub/control/SettingsControl.java b/src/jrummikub/control/SettingsControl.java
index 4103a38..abcbd5d 100644
--- a/src/jrummikub/control/SettingsControl.java
+++ b/src/jrummikub/control/SettingsControl.java
@@ -2,6 +2,7 @@ package jrummikub.control;
import java.awt.Color;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -41,6 +42,7 @@ public class SettingsControl {
this.view = view;
this.settings = settings;
view.getSettingsPanel().enableNetworkMode(false);
+
}
/**
@@ -295,6 +297,11 @@ public class SettingsControl {
checkSettings();
+ List<List<Type>> choices = new ArrayList<List<Type>>();
+ for (int i = 0; i < settings.getPlayerList().size(); i++) {
+ choices.add(Arrays.asList(Type.HUMAN, Type.COMPUTER));
+ }
+ view.getSettingsPanel().setPlayerTypeChoices(choices);
view.getSettingsPanel().setGameSettings(settings);
}
diff --git a/src/jrummikub/control/network/NetworkSettingsControl.java b/src/jrummikub/control/network/NetworkSettingsControl.java
index 9459986..b9af560 100644
--- a/src/jrummikub/control/network/NetworkSettingsControl.java
+++ b/src/jrummikub/control/network/NetworkSettingsControl.java
@@ -1,9 +1,11 @@
package jrummikub.control.network;
+import java.util.Arrays;
import java.util.UUID;
import jrummikub.control.SettingsControl;
import jrummikub.model.GameSettings;
+import jrummikub.model.PlayerSettings.Type;
import jrummikub.view.IGameListPanel.GameData;
import jrummikub.view.IView;
@@ -28,6 +30,8 @@ public class NetworkSettingsControl extends SettingsControl {
IView view, GameSettings settings) {
super(view, settings);
this.connectionControl = connectionControl;
+ /*view.getSettingsPanel().setPlayerTypeChoices(
+ Arrays.asList(Type.NETWORK, Type.COMPUTER));*/
view.getSettingsPanel().enableNetworkMode(true);
}