From fffca3fe9a1285dc3a9f009c3431cd907443b7af Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Mon, 9 May 2011 20:27:48 +0200 Subject: Fixed the 12-12-7 bug git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@193 72836036-5685-4462-b002-a69064685172 --- src/jrummikub/model/StoneSet.java | 7 +++++-- 1 file 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, 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, 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, Sizeable { if (i.isJoker()) { continue; } + if (i.getValue() != value) { + return false; + } if (seenColors.contains(i.getColor())) { return false; } else { -- cgit v1.2.3