diff options
Diffstat (limited to 'src/jrummikub/control/SettingsControl.java')
-rw-r--r-- | src/jrummikub/control/SettingsControl.java | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/jrummikub/control/SettingsControl.java b/src/jrummikub/control/SettingsControl.java index f12f1ad..fd01613 100644 --- a/src/jrummikub/control/SettingsControl.java +++ b/src/jrummikub/control/SettingsControl.java @@ -2,12 +2,15 @@ package jrummikub.control; import java.awt.Color; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; import jrummikub.control.turn.TurnControlFactory; import jrummikub.control.turn.TurnControlFactory.Type; import jrummikub.model.GameSettings; import jrummikub.model.PlayerSettings; +import jrummikub.model.StoneColor; import jrummikub.util.Connection; import jrummikub.util.Event1; import jrummikub.util.IEvent1; @@ -83,6 +86,30 @@ public class SettingsControl { update(); } })); + connections.add(view.getSettingsPanel().getChangeNumberOfStonesDealtEvent() + .add(new IListener1<Integer>() { + @Override + public void handle(Integer value) { + settings.setNumberOfStonesDealt(value); + update(); + } + })); + connections.add(view.getSettingsPanel().getChangeHighestValueEvent() + .add(new IListener1<Integer>() { + @Override + public void handle(Integer value) { + settings.setHighestValue(value); + update(); + } + })); + connections.add(view.getSettingsPanel().getChangeStoneColorsEvent() + .add(new IListener1<Set<StoneColor>>() { + @Override + public void handle(Set<StoneColor> value) { + settings.setStoneColors(new HashSet<StoneColor>(value)); + update(); + } + })); addPlayerSettingsListeners(); @@ -242,7 +269,7 @@ public class SettingsControl { int totalStonesDealt = settings.getNumberOfStonesDealt() * settings.getPlayerList().size(); - int totalStones = settings.getHighestCard() + int totalStones = settings.getHighestValue() * settings.getStoneSetNumber() * settings.getStoneColors().size() + settings.getJokerNumber(); |