Skip to content

Commit

Permalink
Merge branch 'dev' into auto-format-code-1712090653
Browse files Browse the repository at this point in the history
  • Loading branch information
charlestian23 authored Apr 2, 2024
2 parents 59e4b81 + ef00322 commit 582a1ab
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.Set;

public class FinishRoomCaseRule extends CaseRule {
private int legitCases = 0; //placeholder for amount of cases originally generated in case user tries to delete cases
public FinishRoomCaseRule() {
super(
"NURI-CASE-0002",
Expand Down Expand Up @@ -46,6 +47,9 @@ public String checkRuleRaw(TreeTransition transition) {
return super.getInvalidUseOfRuleMessage()
+ ": This case rule must have 2 or more children.";
}
if (childTransitions.size() != legitCases) {
return super.getInvalidUseOfRuleMessage() + ": Cases can not be removed from the branch.";
} //stops user from deleting 1 or mose generated cases and still having path show as green
Set<Point> locations = new HashSet<>();
for (TreeTransition t1 : childTransitions) {
locations.add(
Expand Down Expand Up @@ -220,7 +224,7 @@ public ArrayList<Board> getCases(
regions = NurikabeUtilities.getNurikabeRegions(nuriBoard); // updates regions
}
}
}
legitCases = cases.size();
return cases;
}

Expand Down

0 comments on commit 582a1ab

Please sign in to comment.