summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/control/AbstractSettingsControl.java
diff options
context:
space:
mode:
authorJannis Harder <harder@informatik.uni-luebeck.de>2011-06-20 02:19:47 +0200
committerJannis Harder <harder@informatik.uni-luebeck.de>2011-06-20 02:19:47 +0200
commitace7175f1a57f3dc88a861842969e84efacf65ad (patch)
tree98408e214e12933fc193cc3d340aeb0f3aeda071 /src/jrummikub/control/AbstractSettingsControl.java
parentfcf33eb280d64b0ce376f7fa10d508c153b2ada9 (diff)
downloadJRummikub-ace7175f1a57f3dc88a861842969e84efacf65ad.tar
JRummikub-ace7175f1a57f3dc88a861842969e84efacf65ad.zip
Continued side panel
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@499 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/control/AbstractSettingsControl.java')
-rw-r--r--src/jrummikub/control/AbstractSettingsControl.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/jrummikub/control/AbstractSettingsControl.java b/src/jrummikub/control/AbstractSettingsControl.java
index 45802a7..7a38478 100644
--- a/src/jrummikub/control/AbstractSettingsControl.java
+++ b/src/jrummikub/control/AbstractSettingsControl.java
@@ -33,9 +33,9 @@ public abstract class AbstractSettingsControl {
* Create a new settings control
*
* @param view
- * the view to use
+ * the view to use
* @param settings
- * initial game settings
+ * initial game settings
*/
protected AbstractSettingsControl(IView view, GameSettings settings) {
this.view = view;
@@ -43,8 +43,10 @@ public abstract class AbstractSettingsControl {
view.getSettingsPanel().setPlayerNamesEditable(
Collections.<Boolean> emptyList());
- view.getSettingsPanel().setPlayerColors(
- new HashSet<Color>(Arrays.asList(ISettingsPanel.PLAYER_COLORS)));
+ view.getSettingsPanel()
+ .setPlayerColors(
+ new HashSet<Color>(Arrays
+ .asList(ISettingsPanel.PLAYER_COLORS)));
}
protected void addListeners() {
@@ -95,7 +97,8 @@ public abstract class AbstractSettingsControl {
private void addOptionListeners1() {
connections.add(view.getSettingsPanel()
- .getChangeInitialMeldThresholdEvent().add(new IListener1<Integer>() {
+ .getChangeInitialMeldThresholdEvent()
+ .add(new IListener1<Integer>() {
@Override
public void handle(Integer value) {
settings.setInitialMeldThreshold(value);
@@ -120,7 +123,8 @@ public abstract class AbstractSettingsControl {
update();
}
}));
- connections.add(view.getSettingsPanel().getChangeNumberOfStonesDealtEvent()
+ connections.add(view.getSettingsPanel()
+ .getChangeNumberOfStonesDealtEvent()
.add(new IListener1<Integer>() {
@Override
public void handle(Integer value) {
@@ -278,8 +282,9 @@ public abstract class AbstractSettingsControl {
for (int j = i + 1; j < settings.getPlayerList().size(); ++j) {
PlayerSettings player2 = settings.getPlayerList().get(j);
if (player2.getName().equals(name) && player2.getType() == type) {
- view.getSettingsPanel().setError(
- ISettingsPanel.SettingsError.DUPLICATE_PLAYER_NAME_ERROR);
+ view.getSettingsPanel()
+ .setError(
+ ISettingsPanel.SettingsError.DUPLICATE_PLAYER_NAME_ERROR);
view.getSettingsPanel().enableStartGameButton(false);
return false;
}
@@ -291,8 +296,7 @@ public abstract class AbstractSettingsControl {
private boolean checkErrors() {
int totalStonesDealt = settings.getNumberOfStonesDealt()
* settings.getPlayerList().size();
- int totalStones = settings.getHighestValue() * settings.getStoneSetNumber()
- * settings.getStoneColors().size() + settings.getJokerNumber();
+ int totalStones = settings.getTotalStones();
if (totalStones <= totalStonesDealt) {
view.getSettingsPanel().setError(