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:
parent
c33e14d54b
commit
fffca3fe9a
1 changed files with 5 additions and 2 deletions
|
@ -68,7 +68,7 @@ public class StoneSet implements Iterable<Stone>, Sizeable {
|
||||||
}
|
}
|
||||||
// is group
|
// is group
|
||||||
else {
|
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
|
* Test for rule conflict within the StoneSet, assuming we have a group
|
||||||
*/
|
*/
|
||||||
private boolean isValidGroup() {
|
private boolean isValidGroup(int value) {
|
||||||
if (stones.size() > 4) {
|
if (stones.size() > 4) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -113,6 +113,9 @@ public class StoneSet implements Iterable<Stone>, Sizeable {
|
||||||
if (i.isJoker()) {
|
if (i.isJoker()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (i.getValue() != value) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (seenColors.contains(i.getColor())) {
|
if (seenColors.contains(i.getColor())) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
|
Reference in a new issue