From ee22ec01e757bcd4e113ed75f84e3bc5b8f3048c Mon Sep 17 00:00:00 2001 From: Zachary Bonagura Date: Fri, 14 Jun 2024 14:06:49 -0400 Subject: [PATCH] Created EliminateTheImpossible direct rule --- .../binary/rules/EliminateTheImpossible.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/main/java/edu/rpi/legup/puzzle/binary/rules/EliminateTheImpossible.java diff --git a/src/main/java/edu/rpi/legup/puzzle/binary/rules/EliminateTheImpossible.java b/src/main/java/edu/rpi/legup/puzzle/binary/rules/EliminateTheImpossible.java new file mode 100644 index 000000000..311057f94 --- /dev/null +++ b/src/main/java/edu/rpi/legup/puzzle/binary/rules/EliminateTheImpossible.java @@ -0,0 +1,35 @@ +package edu.rpi.legup.puzzle.binary.rules; + + +import edu.rpi.legup.model.gameboard.Board; +import edu.rpi.legup.model.gameboard.PuzzleElement; +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.binary.BinaryBoard; +import edu.rpi.legup.puzzle.binary.BinaryCell; + +public class EliminateTheImpossible extends DirectRule { + private final String INVALID_USE_MESSAGE = "Number at cell is incorrect"; + + public EliminateTheImpossible() { + super( + "BINA-BASC-0003", + "Eliminate The Impossible", + "If three adjacent empty cells are open, prevents a trio of numbers to exist", + "edu/rpi/legup/images/binary/rules/OneTileGapDirectRule.png"); + } + + @Override + public String checkRuleRawAt(TreeTransition transition, PuzzleElement puzzleElement) { + BinaryBoard origBoard = (BinaryBoard) transition.getParents().get(0).getBoard(); + BinaryCell binaryCell = (BinaryCell) puzzleElement; + + return "Grouping of Three Ones or Zeros not found"; + } + + @Override + public Board getDefaultBoard(TreeNode node) { + return null; + } +}