net.sf.freecol.common.model
Class BuildingType

java.lang.Object
  extended by net.sf.freecol.common.model.BuildingType

public final class BuildingType
extends java.lang.Object

Contains information on building types, like the number of upgrade levels a given building type can have. The levels contain the information about the name of the building in a given level and what is needed to build it.


Nested Class Summary
static class BuildingType.Level
          Gives informations about the different levels a building can have.
 
Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String LICENSE
           
static java.lang.String REVISION
           
 
Constructor Summary
BuildingType()
           
 
Method Summary
 java.util.List<BuildingType.Level> getLevels()
          Returns a list containing all the possible levels for the given building type.
 BuildingType.Level level(int levelIndex)
          Returns a Level object giving informations about the possible levels of a building.
 int numberOfLevels()
          Returns the number of levels a the given building type can have.
 void readFromXmlElement(org.w3c.dom.Node xml)
          Reads the content of this BuildingType object from the given XML node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

LICENSE

public static final java.lang.String LICENSE
See Also:
Constant Field Values

REVISION

public static final java.lang.String REVISION
See Also:
Constant Field Values
Constructor Detail

BuildingType

public BuildingType()
Method Detail

readFromXmlElement

public void readFromXmlElement(org.w3c.dom.Node xml)
Reads the content of this BuildingType object from the given XML node.

Parameters:
xml - an XML node from which to fill this BuildingType's fields.

getLevels

public java.util.List<BuildingType.Level> getLevels()
Returns a list containing all the possible levels for the given building type.

Returns:
a list containing all the Level objects for the given building.

numberOfLevels

public int numberOfLevels()
Returns the number of levels a the given building type can have.

Returns:
the number of possible levels for the given building type.

level

public BuildingType.Level level(int levelIndex)
Returns a Level object giving informations about the possible levels of a building.

Parameters:
levelIndex - the level for which to retrieve information.
Returns:
a Level object.