summaryrefslogtreecommitdiffstats
path: root/src/jrummikub
diff options
context:
space:
mode:
authorJannis Harder <harder@informatik.uni-luebeck.de>2011-05-09 20:27:48 +0200
committerJannis Harder <harder@informatik.uni-luebeck.de>2011-05-09 20:27:48 +0200
commitfffca3fe9a1285dc3a9f009c3431cd907443b7af (patch)
treea911c2c5a17b00c0829120a4d4fa7e500da13b4c /src/jrummikub
parentc33e14d54b0a48e8d5f0a865c8ca7c88eddf134c (diff)
downloadJRummikub-fffca3fe9a1285dc3a9f009c3431cd907443b7af.tar
JRummikub-fffca3fe9a1285dc3a9f009c3431cd907443b7af.zip
Fixed the 12-12-7 bug
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@193 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'src/jrummikub')
-rw-r--r--src/jrummikub/model/StoneSet.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/jrummikub/model/StoneSet.java b/src/jrummikub/model/StoneSet.java
index 98a808e..3723e75 100644
--- a/src/jrummikub/model/StoneSet.java
+++ b/src/jrummikub/model/StoneSet.java
@@ -68,7 +68,7 @@ public class StoneSet implements Iterable<Stone>, Sizeable {
}
// is group
else {
- return isValidGroup() ? GROUP : INVALID;
+ return isValidGroup(stones.get(nonJoker1).getValue()) ? GROUP : INVALID;
}
}
@@ -104,7 +104,7 @@ public class StoneSet implements Iterable<Stone>, Sizeable {
/**
* Test for rule conflict within the StoneSet, assuming we have a group
*/
- private boolean isValidGroup() {
+ private boolean isValidGroup(int value) {
if (stones.size() > 4) {
return false;
}
@@ -113,6 +113,9 @@ public class StoneSet implements Iterable<Stone>, Sizeable {
if (i.isJoker()) {
continue;
}
+ if (i.getValue() != value) {
+ return false;
+ }
if (seenColors.contains(i.getColor())) {
return false;
} else {