Added more fields to GameSettings

git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@306 72836036-5685-4462-b002-a69064685172
This commit is contained in:
Jannis Harder 2011-05-29 19:14:28 +02:00
parent c09a94a359
commit f62b953c9e

View file

@ -1,7 +1,11 @@
package jrummikub.model; package jrummikub.model;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set;
import static jrummikub.model.StoneColor.*;
/** /**
* The overall game settings * The overall game settings
@ -12,6 +16,10 @@ public class GameSettings {
private int initialMeldThreshold; private int initialMeldThreshold;
private int jokerPoints; private int jokerPoints;
private int jokerNumber; private int jokerNumber;
private int highestCard;
private int stoneSets;
private boolean noLimits;
private Set<StoneColor> stoneColors;
/** /**
* Creates new GameSettings with default values * Creates new GameSettings with default values
@ -20,6 +28,11 @@ public class GameSettings {
initialMeldThreshold = 30; initialMeldThreshold = 30;
jokerPoints = 50; jokerPoints = 50;
jokerNumber = 2; jokerNumber = 2;
highestCard = 13;
stoneSets = 2;
noLimits = false;
stoneColors = new HashSet<StoneColor>(Arrays.asList(BLACK, BLUE,
ORANGE, RED));
} }
/** /**
@ -86,4 +99,80 @@ public class GameSettings {
public int getJokerNumber() { public int getJokerNumber() {
return jokerNumber; 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<StoneColor> getStoneColors() {
return stoneColors;
}
/**
* Set stone colors used
*
* @param stoneColors
* used stone colors
*/
public void setStoneColors(Set<StoneColor> stoneColors) {
this.stoneColors = stoneColors;
}
} }