Package net.sf.colossus.xmlparser
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 String
private static final Logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
fillCreatureLoader
(InputStream creIS, List<String> varDirectoriesList) private boolean
getAttributeBoolean
(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 void
handleCreature
(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.JDOMException
ObjectCreationException
-
getCreatureTypesAsList
Description copied from interface:AllCreatureType
Retrieve all the CreatureType in the game. They are sorted by name.- Specified by:
getCreatureTypesAsList
in interfaceAllCreatureType
- Returns:
- The immutable list of all CreatureType in the Variant.
-
getCreatureTypes
Description copied from interface:AllCreatureType
Retrieve all the CreatureType in the game. The set is sorted by the natural order of CreatureType- Specified by:
getCreatureTypes
in interfaceAllCreatureType
- Returns:
- The immutable SortedSet of all CreatureType in the Variant.
-
getCreatureTypeByName
Description copied from interface:AllCreatureType
Convert a name into the actual CreatureType- Specified by:
getCreatureTypeByName
in interfaceAllCreatureType
- Parameters:
name
- The name of the CreatureType- Returns:
- The CreatureType of name name.
-