Package edu.wisc.game.engine
Class AllRuleSets
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,RuleSet>
public class AllRuleSets extends HashMap<String,RuleSet>
Stores rule sets, and allows lookup by name.
FIXME: need a web UI for calling clear() on this table, whenever
a new version of the same rule set file is created.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
Constructor Summary
Constructors Constructor Description AllRuleSets()
-
Method Summary
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Constructor Details
-
AllRuleSets
public AllRuleSets()
-
-
Method Details
-
read
- Parameters:
f
- The rule set file. if null is given (for the convenience of the command-line random-board generator), we create an all-permissive rule set.- Throws:
IOException
RuleParseException
-
obtain
- Parameters:
ruleSetName
- Either a name with no path or extension (which will be mapped to a rule set file in the tomcat directory), or a full file path name (beginning with a "/" and ending in ".txt").- Throws:
IOException
RuleParseException
-
clearAll
public static void clearAll()Can be used to ensure that the rule sets will be reloaded
-