Class RuleSet.Atom

  • Enclosing class:
    RuleSet

    public static class RuleSet.Atom
    extends Object
    Syntax:(counter,shape,color,position,bucketFunctions)

    Example: (10,square,*,*,[1,2]) (10,*,blue,10,[2,3])

    • Field Detail

      • counter

        public final int counter
        -1 means "no limit"
      • shapes

        public final Piece.Shape[] shapes
        For shape-and-color pieces, determines acceptable shapes. Null means "no restriction"
      • colors

        public Piece.Color[] colors
        For shape-and-color pieces, determines acceptable colors. Null means "no restriction"
    • Method Detail

      • toSrc

        public String toSrc()
        Format as the source code of the rules set
      • acceptsColorShapeAndProperties

        public boolean acceptsColorShapeAndProperties​(Piece p)
        Does this atom accept a specified piece, based on its shape and color?