Fixed the 12-12-7 bug

git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@193 72836036-5685-4462-b002-a69064685172
This commit is contained in:
Jannis Harder 2011-05-09 20:27:48 +02:00
parent c33e14d54b
commit fffca3fe9a

View file

@ -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 {