diff --git a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/FinishRoomCaseRule.java b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/FinishRoomCaseRule.java index 9f620796c..47ad7af37 100644 --- a/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/FinishRoomCaseRule.java +++ b/src/main/java/edu/rpi/legup/puzzle/nurikabe/rules/FinishRoomCaseRule.java @@ -18,13 +18,13 @@ import java.util.Set; public class FinishRoomCaseRule extends CaseRule { - public FinishRoomCaseRule() { super("NURI-CASE-0002", "Finish Room", "Room can be finished in up to five ways", - "edu/rpi/legup/images/nurikabe/cases/FinishRoom.png"); //new image + "edu/rpi/legup/images/nurikabe/cases/FinishRoom.png"); this.MAX_CASES = 5; + this.MIN_CASES = 2; } /** @@ -41,6 +41,9 @@ public String checkRuleRaw(TreeTransition transition) { if (childTransitions.size() > 5) { return super.getInvalidUseOfRuleMessage() + ": This case rule must have 5 or less children."; } + if(childTransitions.size() < 2) { + return super.getInvalidUseOfRuleMessage() + ": This case rule must have 2 or more children."; + } Set locations = new HashSet<>(); for (TreeTransition t1 : childTransitions) { locations.add(((NurikabeCell) t1.getBoard().getModifiedData().iterator().next()).getLocation()); //loop see if matches