Class CreatureLoader

java.lang.Object
net.sf.colossus.xmlparser.CreatureLoader
All Implemented Interfaces:
AllCreatureType

public class CreatureLoader extends Object implements AllCreatureType
CreatureLoader loads the creature descriptions.
Version:
$Id: CreatureLoader.java 4053 2009-04-21 12:40:24Z dolbeau $
Author:
Romain Dolbeau
See Also:
  • Field Details

  • Constructor Details

    • CreatureLoader

      public CreatureLoader()
  • Method Details

    • fillCreatureLoader

      public void fillCreatureLoader(InputStream creIS, List<String> varDirectoriesList)
    • getAttributeBoolean

      private boolean getAttributeBoolean(org.jdom.Element el, String name) throws org.jdom.JDOMException
      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

      public List<CreatureType> getCreatureTypesAsList()
      Description copied from interface: AllCreatureType
      Retrieve all the CreatureType in the game. They are sorted by name.
      Specified by:
      getCreatureTypesAsList in interface AllCreatureType
      Returns:
      The immutable list of all CreatureType in the Variant.
    • getCreatureTypes

      public SortedSet<CreatureType> 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 interface AllCreatureType
      Returns:
      The immutable SortedSet of all CreatureType in the Variant.
    • getCreatureTypeByName

      public CreatureType getCreatureTypeByName(String name)
      Description copied from interface: AllCreatureType
      Convert a name into the actual CreatureType
      Specified by:
      getCreatureTypeByName in interface AllCreatureType
      Parameters:
      name - The name of the CreatureType
      Returns:
      The CreatureType of name name.