From c004a07a4267f3320d23f3d1d2cf483cd56f40b7 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 31 May 2011 01:50:56 +0200 Subject: 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 --- src/jrummikub/control/SettingsControl.java | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'src/jrummikub/control') 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() { + @Override + public void handle(Integer value) { + settings.setNumberOfStonesDealt(value); + update(); + } + })); + connections.add(view.getSettingsPanel().getChangeHighestValueEvent() + .add(new IListener1() { + @Override + public void handle(Integer value) { + settings.setHighestValue(value); + update(); + } + })); + connections.add(view.getSettingsPanel().getChangeStoneColorsEvent() + .add(new IListener1>() { + @Override + public void handle(Set value) { + settings.setStoneColors(new HashSet(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(); -- cgit v1.2.3