Package com.takenoko.shape
Class Pattern
java.lang.Object
com.takenoko.shape.Shape
com.takenoko.shape.Pattern
- Direct Known Subclasses:
Curve,Diamond,Line,MixedColorsDiamond,Triangle
Class representing a pattern.
-
Field Summary
FieldsFields inherited from class com.takenoko.shape.Shape
THE_SHAPE_CANNOT_BE_EMPTY_EXCEPTION -
Constructor Summary
ConstructorsConstructorDescriptionPattern(List<Map.Entry<PositionVector, Tile>> toList) Pattern(org.apache.commons.lang3.tuple.Pair<PositionVector, Tile>... elements) Constructor for the Pattern class. -
Method Summary
Modifier and TypeMethodDescriptionboolean(package private) StringgetSubsetMatchPattern(Board board, int startingSize, boolean ignoreIrrigation) inthashCode()Method to match a shape on the board.Methods inherited from class com.takenoko.shape.Shape
copy, getElements, getMissingShape, getRotatedShape, getRotatedShapes, rotate60, rotate60, toString, translate
-
Field Details
-
cache
-
-
Constructor Details
-
Pattern
Constructor for the Pattern class. The origin is the element the closest to the origin of the coordinate system.- Parameters:
elements- the elements of the pattern
-
Pattern
-
-
Method Details
-
hashCode
public int hashCode() -
match
Method to match a shape on the board.- Parameters:
board- the board- Returns:
- the matching translated/rotated shapes
-
match
-
getSubsetMatchPattern
-
equals
-
getColorsString
String getColorsString() -
getShapesToCompletePatternObjective
-