diff options
Diffstat (limited to 'src/jrummikub/model/GameSettings.java')
-rw-r--r-- | src/jrummikub/model/GameSettings.java | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/jrummikub/model/GameSettings.java b/src/jrummikub/model/GameSettings.java index 2a8ae0b..671b57c 100644 --- a/src/jrummikub/model/GameSettings.java +++ b/src/jrummikub/model/GameSettings.java @@ -2,6 +2,7 @@ package jrummikub.model; import static jrummikub.model.StoneColor.*; +import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; @@ -11,8 +12,10 @@ import java.util.Set; /** * The overall game settings */ -public class GameSettings { - private List<PlayerSettings> players = new ArrayList<PlayerSettings>(); +public class GameSettings implements Serializable { + private static final long serialVersionUID = -7221346125938175643L; + + private ArrayList<PlayerSettings> players = new ArrayList<PlayerSettings>(); private int initialMeldThreshold; private int jokerPoints; @@ -21,7 +24,7 @@ public class GameSettings { private int stoneSetNumber; private int numberOfStonesDealt; private boolean noLimits; - private Set<StoneColor> stoneColors; + private HashSet<StoneColor> stoneColors; /** * Creates new GameSettings with default values @@ -34,8 +37,8 @@ public class GameSettings { stoneSetNumber = 2; numberOfStonesDealt = 14; noLimits = false; - stoneColors = new HashSet<StoneColor>(Arrays.asList(BLACK, BLUE, - ORANGE, RED)); + stoneColors = new HashSet<StoneColor>(Arrays.asList(BLACK, BLUE, ORANGE, + RED)); } /** @@ -51,7 +54,7 @@ public class GameSettings { * Sets the initial meld threshold * * @param value - * the value to set + * the value to set */ public void setInitialMeldThreshold(int value) { initialMeldThreshold = value; @@ -70,7 +73,7 @@ public class GameSettings { * Sets the points counted for a joker * * @param value - * the value to set + * the value to set */ public void setJokerPoints(int value) { jokerPoints = value; @@ -89,7 +92,7 @@ public class GameSettings { * Sets the number of jokers in game * * @param value - * how many jokers will be used + * how many jokers will be used */ public void setJokerNumber(int value) { jokerNumber = value; @@ -117,7 +120,7 @@ public class GameSettings { * Set the highest stone value in use * * @param highestValue - * highest stone value + * highest stone value */ public void setHighestValue(int highestValue) { this.highestValue = highestValue; @@ -136,7 +139,7 @@ public class GameSettings { * Set the number of sets of stones in use * * @param stoneSets - * sets of stones in use + * sets of stones in use */ public void setStoneSetNumber(int stoneSets) { this.stoneSetNumber = stoneSets; @@ -155,7 +158,7 @@ public class GameSettings { * Set whether "No-Limits" rules are used * * @param noLimits - * use no limit rules + * use no limit rules */ public void setNoLimits(boolean noLimits) { this.noLimits = noLimits; @@ -174,10 +177,10 @@ public class GameSettings { * Set stone colors used * * @param stoneColors - * used stone colors + * used stone colors */ public void setStoneColors(Set<StoneColor> stoneColors) { - this.stoneColors = stoneColors; + this.stoneColors = new HashSet<StoneColor>(stoneColors); } /** @@ -193,7 +196,7 @@ public class GameSettings { * Set number of stones dealt at game start * * @param number - * how many Stones will be dealt initially + * how many Stones will be dealt initially */ public void setNumberOfStonesDealt(int number) { numberOfStonesDealt = number; |