Package edu.wisc.game.engine
Class AllRuleSets
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<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:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
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
-