Skip to content

Commit

Permalink
Refactored two classes
Browse files Browse the repository at this point in the history
Refactored two classes to reflect new rule names and updated reference sheet to reflect this change
  • Loading branch information
charlestian23 committed Jun 16, 2022
1 parent 49aedcd commit 0ddb91a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
import edu.rpi.legup.puzzle.nurikabe.NurikabeType;

public class UnreachableBasicRule extends BasicRule {
public UnreachableBasicRule() {
public class CannotReachCellBasicRule extends BasicRule {
public CannotReachCellBasicRule() {
super("NURI-BASC-0008",
"Can't Reach Cell",
"A cell must be black if it cannot be reached by any white region",
Expand All @@ -29,7 +29,7 @@ public UnreachableBasicRule() {
*/
@Override
protected String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) {
ContradictionRule contraRule = new CantReachWhiteContradictionRule();
ContradictionRule contraRule = new UnreachableWhiteCellContradictionRule();

NurikabeBoard destBoardState = (NurikabeBoard) transition.getBoard();
NurikabeCell cell = (NurikabeCell) destBoardState.getPuzzleElement(puzzleElement);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
import java.util.ArrayList;
import java.util.Set;

public class CantReachWhiteContradictionRule extends ContradictionRule {
public class UnreachableWhiteCellContradictionRule extends ContradictionRule {

private final String NO_CONTRADICTION_MESSAGE = "Cell at this index can be reached";
private final String INVALID_USE_MESSAGE = "Does not contain a contradiction at this index";

public CantReachWhiteContradictionRule() {
public UnreachableWhiteCellContradictionRule() {
super("NURI-CONT-0002",
"Unreachable White Cell",
"A white cell must be able to reach a white region",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ NURI-BASC-0004 : FillinBlackBasicRule
NURI-BASC-0005 : FillinWhiteBasicRule
NURI-BASC-0006 : PreventBlackSquareBasicRule
NURI-BASC-0007 : SurroundRegionBasicRule
NURI-BASC-0008 : UnreachableBasicRule
NURI-BASC-0008 : CannotReachCellBasicRule
NURI-BASC-0009 : WhiteBottleNeckBasicRule

NURI-CONT-0001 : BlackSquareContradictionRule
NURI-CONT-0002 : CantReachWhiteContradictionRule
NURI-CONT-0002 : UnreachableWhiteCellContradictionRule
NURI-CONT-0003 : IsolateBlackContradictionRule
NURI-CONT-0004 : MultipleNumbersContradictionRule
NURI-CONT-0005 : NoNumberContradictionRule
Expand Down

0 comments on commit 0ddb91a

Please sign in to comment.