public class CreatureLoader extends java.lang.Object implements AllCreatureType
CreatureType
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,CreatureType> |
byName |
private java.util.SortedSet<CreatureType> |
creatures |
private static java.lang.String |
currentVersion |
private static java.util.logging.Logger |
LOGGER |
Constructor and Description |
---|
CreatureLoader() |
Modifier and Type | Method and Description |
---|---|
void |
fillCreatureLoader(java.io.InputStream creIS,
java.util.List<java.lang.String> varDirectoriesList) |
private boolean |
getAttributeBoolean(org.jdom.Element el,
java.lang.String name)
Lookup attribute of name name in Element el, and return
its value as boolean.
|
CreatureType |
getCreatureTypeByName(java.lang.String name)
Convert a name into the actual CreatureType
|
java.util.SortedSet<CreatureType> |
getCreatureTypes()
Retrieve all the CreatureType in the game.
|
java.util.List<CreatureType> |
getCreatureTypesAsList()
Retrieve all the CreatureType in the game.
|
private void |
handleCreature(org.jdom.Element el,
java.util.List<java.lang.String> varDirectoriesList) |
private static final java.util.logging.Logger LOGGER
private static final java.lang.String currentVersion
private final java.util.SortedSet<CreatureType> creatures
private final java.util.Map<java.lang.String,CreatureType> byName
public void fillCreatureLoader(java.io.InputStream creIS, java.util.List<java.lang.String> varDirectoriesList)
private boolean getAttributeBoolean(org.jdom.Element el, java.lang.String name) throws org.jdom.JDOMException
el
- The element with the attribute (or not)name
- The name of the attributeorg.jdom.JDOMException
private void handleCreature(org.jdom.Element el, java.util.List<java.lang.String> varDirectoriesList) throws org.jdom.JDOMException, ObjectCreationException
org.jdom.JDOMException
ObjectCreationException
public java.util.List<CreatureType> getCreatureTypesAsList()
AllCreatureType
getCreatureTypesAsList
in interface AllCreatureType
public java.util.SortedSet<CreatureType> getCreatureTypes()
AllCreatureType
getCreatureTypes
in interface AllCreatureType
public CreatureType getCreatureTypeByName(java.lang.String name)
AllCreatureType
getCreatureTypeByName
in interface AllCreatureType
name
- The name of the CreatureType