Class FixedAmountPerBlock

java.lang.Object
math.wfc.rules.Rule
math.wfc.rules.FixedAmountPerBlock

public class FixedAmountPerBlock extends Rule
A Rule that forces a certain amount of tiles to be inside each width x height area of the grid.
  • Constructor Details

    • FixedAmountPerBlock

      public FixedAmountPerBlock(int a, int w, int h)
      Constructer for a Rule that forces a certain count of tile to be in a certain row.
      Parameters:
      a - The amount of tiles in each row
  • Method Details

    • getState

      public Rule.STATE getState(Gridstate grid, int x, int y, Tile t)
      Description copied from class: Rule
      A function to test if the Rule is fullfilled
      Specified by:
      getState in class Rule
      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()
      Description copied from class: Rule
      A function that rotates the rule clockwise.
      Overrides:
      rotate in class Rule
      Returns:
      A rotated version of the rule
    • mirrorX

      public Rule mirrorX()
      Description copied from class: Rule
      A function that mirrors the rule along the x-Axis
      Overrides:
      mirrorX in class Rule
      Returns:
      A mirrored version of the rule
    • mirrorY

      public Rule mirrorY()
      Description copied from class: Rule
      A function that mirrors the rule along the y-Axis
      Overrides:
      mirrorY in class Rule
      Returns:
      A mirrores version of the rule