Package edu.wisc.game.engine
Class RuleSet
java.lang.Object
edu.wisc.game.engine.RuleSet
A RuleSet describes the rules of a game.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Syntax:(counter,shape,color,position,bucketFunctions)static class
A BucketList represents the information about the destination buckets given in the "buckets" field of an atom.static enum
The list of "legacy" variables that can be used in the bucket expression.class
This is used for pretty-printing in the GUI client.static class
A row object represents the content of one line of the rule set description file, i.e. -
Field Summary
FieldsModifier and TypeFieldDescriptionAn optional verbal description of the rule set, which may have been found in the comment lines on top of the rule set file.The display name, to show in the Android app, without giving the user too much of a hint.All ordersAll rows of this rule set -
Constructor Summary
ConstructorsConstructorDescriptionCreates a RuleSet based on the content of a rule set file.RuleSet
(String[] rr, AutomaticRuleGenerator agen) RuleSet
(String ruleText, AutomaticRuleGenerator agen) -
Method Summary
Modifier and TypeMethodDescriptiongetFile()
The list of variables mentioned in the bucket expressions in this rowLists all colors used in this rule set.Lists all properties, and all property values, used in this rule set.Lists all shapes used in this rule set.static void
toSrc()
Format as the source code of the rules settoString()
-
Field Details
-
description
An optional verbal description of the rule set, which may have been found in the comment lines on top of the rule set file. -
display
The display name, to show in the Android app, without giving the user too much of a hint. (As per PK, 2023-01-24) -
orders
All orders -
rows
All rows of this rule set
-
-
Constructor Details
-
RuleSet
- Throws:
RuleParseException
-
RuleSet
- Throws:
RuleParseException
-
RuleSet
Creates a RuleSet based on the content of a rule set file. The file may contain some (optional) custom order definition lines, followed by one or more rule lines.- Parameters:
rr
- The lines from the rule set file- Throws:
RuleParseException
-
RuleSet
- Throws:
RuleParseException
-
-
Method Details
-
getFile
-
toString
-
toSrc
Format as the source code of the rules set -
reportSrc
-
listAllShapes
Lists all shapes used in this rule set. -
listAllColors
Lists all colors used in this rule set. -
listAllPropValues
Lists all properties, and all property values, used in this rule set. This is primarily used for correctness checking during the experiment plan validation. -
listAllBucketVars
The list of variables mentioned in the bucket expressions in this row -
main
- Throws:
IOException
RuleParseException
-