Class CreatureLoader
java.lang.Object
net.sf.colossus.xmlparser.CreatureLoader
- All Implemented Interfaces:
AllCreatureType
CreatureLoader loads the creature descriptions.
- Version:
- $Id: CreatureLoader.java 4053 2009-04-21 12:40:24Z dolbeau $
- Author:
- Romain Dolbeau
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<String, CreatureType> private final SortedSet<CreatureType> private static final Stringprivate static final Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfillCreatureLoader(InputStream creIS, List<String> varDirectoriesList) private booleangetAttributeBoolean(org.jdom.Element el, String name) Lookup attribute of name name in Element el, and return its value as boolean.getCreatureTypeByName(String name) Convert a name into the actual CreatureTypeRetrieve all the CreatureType in the game.Retrieve all the CreatureType in the game.private voidhandleCreature(org.jdom.Element el, List<String> varDirectoriesList)
-
Field Details
-
LOGGER
-
currentVersion
- See Also:
-
creatures
-
byName
-
-
Constructor Details
-
CreatureLoader
public CreatureLoader()
-
-
Method Details
-
fillCreatureLoader
-
getAttributeBoolean
Lookup attribute of name name in Element el, and return its value as boolean. Assume lack of attribute means false.- Parameters:
el- The element with the attribute (or not)name- The name of the attribute- Returns:
- The boolean value of the attribute, defaulting to false if absent
- Throws:
org.jdom.JDOMException
-
handleCreature
private void handleCreature(org.jdom.Element el, List<String> varDirectoriesList) throws org.jdom.JDOMException, ObjectCreationException - Throws:
org.jdom.JDOMExceptionObjectCreationException
-
getCreatureTypesAsList
Description copied from interface:AllCreatureTypeRetrieve all the CreatureType in the game. They are sorted by name.- Specified by:
getCreatureTypesAsListin interfaceAllCreatureType- Returns:
- The immutable list of all CreatureType in the Variant.
-
getCreatureTypes
Description copied from interface:AllCreatureTypeRetrieve all the CreatureType in the game. The set is sorted by the natural order of CreatureType- Specified by:
getCreatureTypesin interfaceAllCreatureType- Returns:
- The immutable SortedSet of all CreatureType in the Variant.
-
getCreatureTypeByName
Description copied from interface:AllCreatureTypeConvert a name into the actual CreatureType- Specified by:
getCreatureTypeByNamein interfaceAllCreatureType- Parameters:
name- The name of the CreatureType- Returns:
- The CreatureType of name name.
-