diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-05-31 01:50:56 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-05-31 01:50:56 +0200 |
commit | c004a07a4267f3320d23f3d1d2cf483cd56f40b7 (patch) | |
tree | 97ea6ce039c22c9cece01bf59a686edb0ba14d1a /src/jrummikub/control | |
parent | c78e8e64484b887cbdd2f5e903ce25828c93e08a (diff) | |
download | JRummikub-c004a07a4267f3320d23f3d1d2cf483cd56f40b7.tar JRummikub-c004a07a4267f3320d23f3d1d2cf483cd56f40b7.zip |
Make highest value and number of stones dealt settable
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@337 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub/control')
-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(); |