Skip to content

Commit

Permalink
Update EmptyAdjacentDirectRule.java
Browse files Browse the repository at this point in the history
Undoing changes to fix merge conflict
  • Loading branch information
offline171 committed Oct 16, 2024
1 parent 115c1f4 commit f5e932b
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import edu.rpi.legup.model.rules.DirectRule;
import edu.rpi.legup.model.tree.TreeNode;
import edu.rpi.legup.model.tree.TreeTransition;
import edu.rpi.legup.puzzle.nurikabe.NurikabeCell;
import edu.rpi.legup.puzzle.nurikabe.NurikabeType;
import edu.rpi.legup.puzzle.starbattle.StarBattleBoard;
import edu.rpi.legup.puzzle.starbattle.StarBattleCell;
import edu.rpi.legup.puzzle.starbattle.StarBattleCellType;
Expand Down Expand Up @@ -62,14 +64,18 @@ public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElem
StarBattleCell temp = adjacent[i];

if (temp != null && temp.getType() == StarBattleCellType.UNKNOWN) {
temp.setData(StarBattleCellType.BLACK.value);
int X = temp.getLocation().x;
int Y = temp.getLocation().y;
modified.getCell(X,Y).setData(StarBattleCellType.BLACK.value);
System.out.println("covering square " + X + " " + Y + " type " + modified.getCell(X,Y).getType() + " i = " + i + "\n");
if(contraRule.checkContradictionAt(modified, temp) == null){
System.out.println("Good job!");
return null; //used correctly if even one space causes a toofewstars issue
}
}
}
System.out.println("Wait why did this exit?\n");

return "Black cells must be placed adjacent to a tile(s) where a star is needed!";
}
Expand Down

0 comments on commit f5e932b

Please sign in to comment.