Class Rule

java.lang.Object
math.wfc.rules.Rule
Direct Known Subclasses:
FixedAmountPerBlock, FixedAmountPerColumn, FixedAmountPerRow

public abstract class Rule extends Object
A Interface for functions on a rule.
  • Constructor Details

    • Rule

      public Rule()
  • Method Details

    • getState

      public abstract Rule.STATE getState(Gridstate grid, int x, int y, Tile t)
      A function to test if the Rule is fullfilled
      Parameters:
      grid - the current Gridstate
      x - the x coordinate of the position to test for
      y - the y coordinate of the position to test for
      t - the tile to test for at that position
      Returns:
      The State of this rule (FORCED, POSSIBLE, IMPOSSIBLE or FORBIDDEN)
    • rotate

      public Rule rotate()
      A function that rotates the rule clockwise.
      Returns:
      A rotated version of the rule
    • mirrorX

      public Rule mirrorX()
      A function that mirrors the rule along the x-Axis
      Returns:
      A mirrored version of the rule
    • mirrorY

      public Rule mirrorY()
      A function that mirrors the rule along the y-Axis
      Returns:
      A mirrores version of the rule