From f62b953c9e66e622087bdcaf873614b07e89c761 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Sun, 29 May 2011 19:14:28 +0200 Subject: Added more fields to GameSettings git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@306 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/model/GameSettings.java | 89 +++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) (limited to 'src') diff --git a/src/jrummikub/model/GameSettings.java b/src/jrummikub/model/GameSettings.java index 0feff26..193188f 100644 --- a/src/jrummikub/model/GameSettings.java +++ b/src/jrummikub/model/GameSettings.java @@ -1,7 +1,11 @@ package jrummikub.model; import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; import java.util.List; +import java.util.Set; +import static jrummikub.model.StoneColor.*; /** * The overall game settings @@ -12,6 +16,10 @@ public class GameSettings { private int initialMeldThreshold; private int jokerPoints; private int jokerNumber; + private int highestCard; + private int stoneSets; + private boolean noLimits; + private Set stoneColors; /** * Creates new GameSettings with default values @@ -20,6 +28,11 @@ public class GameSettings { initialMeldThreshold = 30; jokerPoints = 50; jokerNumber = 2; + highestCard = 13; + stoneSets = 2; + noLimits = false; + stoneColors = new HashSet(Arrays.asList(BLACK, BLUE, + ORANGE, RED)); } /** @@ -86,4 +99,80 @@ public class GameSettings { public int getJokerNumber() { return jokerNumber; } + + /** + * Return the highest card value in use + * + * @return highest card value + */ + public int getHighestCard() { + return highestCard; + } + + /** + * Set the highest card value in use + * + * @param highestCard + * highest card value + */ + public void setHighestCard(int highestCard) { + this.highestCard = highestCard; + } + + /** + * Get the number of sets of stones in use + * + * @return sets of stones in use + */ + public int getStoneSets() { + return stoneSets; + } + + /** + * Set the number of sets of stones in use + * + * @param stoneSets + * sets of stones in use + */ + public void setStoneSets(int stoneSets) { + this.stoneSets = stoneSets; + } + + /** + * Use "No-Limits" rules + * + * @return whether No-Limits rules are used + */ + public boolean isNoLimits() { + return noLimits; + } + + /** + * Set whether "No-Limits" rules are used + * + * @param noLimits + * use no limit rules + */ + public void setNoLimits(boolean noLimits) { + this.noLimits = noLimits; + } + + /** + * Get stone colors used + * + * @return used stone colors + */ + public Set getStoneColors() { + return stoneColors; + } + + /** + * Set stone colors used + * + * @param stoneColors + * used stone colors + */ + public void setStoneColors(Set stoneColors) { + this.stoneColors = stoneColors; + } } -- cgit v1.2.3