Package edu.wisc.game.engine
Class RuleSet.Atom
- java.lang.Object
-
- edu.wisc.game.engine.RuleSet.Atom
-
-
Field Summary
Fields Modifier and Type Field Description RuleSet.BucketList
bucketList
Piece.Color[]
colors
For shape-and-color pieces, determines acceptable colors.int
counter
-1 means "no limit"PositionList
plist
The "pos:" components of the atomPositionList
postPlist
The "postpos:" components of the atom GS (ver 6.041)Piece.Shape[]
shapes
If null, there are no shape restrictons; if empty or non-empty array, then either one of the elements must match, or (since GS5) permission may be granted via propertyConditions instead)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptsColorShapeAndProperties(Piece p, Expression.VarMap2 varMap)
Does this atom accept a specified piece, based on its shape, color, and (in GS3+) any other properties? Since GS5, the "code:" field of the atom is also taken into account.String
toSrc()
Formats the Atom as the source code of the rules setString
toString()
-
-
-
Field Detail
-
counter
public final int counter
-1 means "no limit"
-
shapes
public final Piece.Shape[] shapes
If null, there are no shape restrictons; if empty or non-empty array, then either one of the elements must match, or (since GS5) permission may be granted via propertyConditions instead)
-
colors
public Piece.Color[] colors
For shape-and-color pieces, determines acceptable colors. Null means "no restriction"
-
plist
public PositionList plist
The "pos:" components of the atom
-
postPlist
public PositionList postPlist
The "postpos:" components of the atom GS (ver 6.041)
-
bucketList
public RuleSet.BucketList bucketList
-
-
Method Detail
-
toSrc
public String toSrc()
Formats the Atom as the source code of the rules set
-
acceptsColorShapeAndProperties
public boolean acceptsColorShapeAndProperties(Piece p, Expression.VarMap2 varMap)
Does this atom accept a specified piece, based on its shape, color, and (in GS3+) any other properties? Since GS5, the "code:" field of the atom is also taken into account.- Parameters:
varMap
- Map with variable values for expression evaluations. Maybe null before GS5.
-
-