blob: 193188f33e0191483ced68ecd8528470912fe53d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
|
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
*/
public class GameSettings {
private List<PlayerSettings> players = new ArrayList<PlayerSettings>();
private int initialMeldThreshold;
private int jokerPoints;
private int jokerNumber;
private int highestCard;
private int stoneSets;
private boolean noLimits;
private Set<StoneColor> stoneColors;
/**
* Creates new GameSettings with default values
*/
public GameSettings() {
initialMeldThreshold = 30;
jokerPoints = 50;
jokerNumber = 2;
highestCard = 13;
stoneSets = 2;
noLimits = false;
stoneColors = new HashSet<StoneColor>(Arrays.asList(BLACK, BLUE,
ORANGE, RED));
}
/**
* Returns the list containing the settings of all players
*
* @return the player settings list
*/
public List<PlayerSettings> getPlayerList() {
return players;
}
/**
* Sets the initial meld threshold
*
* @param value
* the value to set
*/
public void setInitialMeldThreshold(int value) {
initialMeldThreshold = value;
}
/**
* Returns the initial meld threshold
*
* @return the threshold
*/
public int getInitialMeldThreshold() {
return initialMeldThreshold;
}
/**
* Sets the points counted for a joker
*
* @param value
* the value to set
*/
public void setJokerPoints(int value) {
jokerPoints = value;
}
/**
* Returns the points counted for a joker
*
* @return the points
*/
public int getJokerPoints() {
return jokerPoints;
}
/**
* Sets the number of jokers in game
*
* @param value
*/
public void setJokerNumber(int value) {
jokerNumber = value;
}
/**
* Returns the number of jokers
*
* @return the number of jokers
*/
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<StoneColor> getStoneColors() {
return stoneColors;
}
/**
* Set stone colors used
*
* @param stoneColors
* used stone colors
*/
public void setStoneColors(Set<StoneColor> stoneColors) {
this.stoneColors = stoneColors;
}
}
|