Class Pattern

java.lang.Object
com.takenoko.shape.Shape
com.takenoko.shape.Pattern
Direct Known Subclasses:
Curve, Diamond, Line, MixedColorsDiamond, Triangle

public class Pattern extends Shape
Class representing a pattern.
  • Field Details

  • Constructor Details

    • Pattern

      @SafeVarargs public Pattern(org.apache.commons.lang3.tuple.Pair<PositionVector,Tile>... elements)
      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

      public Pattern(List<Map.Entry<PositionVector,Tile>> toList)
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Shape
    • match

      public List<Shape> match(Board board)
      Method to match a shape on the board.
      Parameters:
      board - the board
      Returns:
      the matching translated/rotated shapes
    • match

      public List<Shape> match(Board board, boolean ignoreIrrigation)
    • getSubsetMatchPattern

      public List<Shape> getSubsetMatchPattern(Board board, int startingSize, boolean ignoreIrrigation)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Shape
    • getColorsString

      String getColorsString()
    • getShapesToCompletePatternObjective

      public List<Shape> getShapesToCompletePatternObjective(Board board)