summaryrefslogtreecommitdiffstats
path: root/src/jrummikub/model/StoneSet.java
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-05-31 01:50:56 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-05-31 01:50:56 +0200
commitc004a07a4267f3320d23f3d1d2cf483cd56f40b7 (patch)
tree97ea6ce039c22c9cece01bf59a686edb0ba14d1a /src/jrummikub/model/StoneSet.java
parentc78e8e64484b887cbdd2f5e903ce25828c93e08a (diff)
downloadJRummikub-c004a07a4267f3320d23f3d1d2cf483cd56f40b7.tar
JRummikub-c004a07a4267f3320d23f3d1d2cf483cd56f40b7.zip
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
Diffstat (limited to 'src/jrummikub/model/StoneSet.java')
-rw-r--r--src/jrummikub/model/StoneSet.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/jrummikub/model/StoneSet.java b/src/jrummikub/model/StoneSet.java
index efe7a2e..3324565 100644
--- a/src/jrummikub/model/StoneSet.java
+++ b/src/jrummikub/model/StoneSet.java
@@ -75,19 +75,19 @@ public class StoneSet implements Iterable<Stone>, Sizeable {
}
if (nonJoker == -1) {
- if (stones.size() > settings.getHighestCard()) {
+ if (stones.size() > settings.getHighestValue()) {
return new Pair<Type, Integer>(INVALID, 0);
} else if (stones.size() > settings.getStoneColors().size()) {
return new Pair<Type, Integer>(
RUN,
- (settings.getHighestCard() * (settings.getHighestCard() + 1))
+ (settings.getHighestValue() * (settings.getHighestValue() + 1))
/ 2
- - (stones.size() - settings.getHighestCard())
- * (stones.size() - settings.getHighestCard() - 1)
+ - (stones.size() - settings.getHighestValue())
+ * (stones.size() - settings.getHighestValue() - 1)
/ 2);
} else {
return new Pair<Type, Integer>(GROUP, stones.size()
- * settings.getHighestCard());
+ * settings.getHighestValue());
}
}
@@ -115,7 +115,7 @@ public class StoneSet implements Iterable<Stone>, Sizeable {
int startValue = stones.get(referencePosition).getValue()
- referencePosition;
int endValue = startValue + stones.size() - 1;
- if (startValue < 1 || endValue > settings.getHighestCard()) {
+ if (startValue < 1 || endValue > settings.getHighestValue()) {
return 0;
}
for (int i = 0; i < stones.size(); i++) {