Package math.wfc.rules
Class Rule
java.lang.Object
math.wfc.rules.Rule
- Direct Known Subclasses:
FixedAmountPerBlock
,FixedAmountPerColumn
,FixedAmountPerRow
A Interface for functions on a rule.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enum used to output the State of the Rule. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Rule.STATE
A function to test if the Rule is fullfilledmirrorX()
A function that mirrors the rule along the x-AxismirrorY()
A function that mirrors the rule along the y-Axisrotate()
A function that rotates the rule clockwise.
-
Constructor Details
-
Rule
public Rule()
-
-
Method Details
-
getState
A function to test if the Rule is fullfilled- Parameters:
grid
- the current Gridstatex
- the x coordinate of the position to test fory
- the y coordinate of the position to test fort
- the tile to test for at that position- Returns:
- The State of this rule (FORCED, POSSIBLE, IMPOSSIBLE or FORBIDDEN)
-
rotate
A function that rotates the rule clockwise.- Returns:
- A rotated version of the rule
-
mirrorX
A function that mirrors the rule along the x-Axis- Returns:
- A mirrored version of the rule
-
mirrorY
A function that mirrors the rule along the y-Axis- Returns:
- A mirrores version of the rule
-