net.sf.freecol.common.model
Class FreeColGameObjectType

java.lang.Object
  extended by net.sf.freecol.common.model.FreeColObject
      extended by net.sf.freecol.common.model.FreeColGameObjectType
Direct Known Subclasses:
BuildableType, DifficultyLevel, FoundingFather, GoodsType, ImprovementActionType, Nation, NationType, ResourceType, TileImprovementType, TileType

public class FreeColGameObjectType
extends FreeColObject

The base class for all types defined by the specification. It can be instantiated in order to provide a source for modifiers and abilities that are provided by the code rather than defined in the specification, such as the "artillery in the open" penalty.


Field Summary
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ID_ATTRIBUTE_TAG
 
Constructor Summary
FreeColGameObjectType()
           
FreeColGameObjectType(java.lang.String id)
           
 
Method Summary
 void addAbility(Ability ability)
           
 void addModifier(Modifier modifier)
           
 FeatureContainer getFeatureContainer()
          Get the FeatureContainer value.
 int getIndex()
           
 java.util.Set<Modifier> getModifierSet(java.lang.String id)
           
 boolean hasAbility(java.lang.String id)
          Describe hasAbility method here.
 boolean hasAbility(java.lang.String id, FreeColGameObjectType type)
           
 void readChildren(javax.xml.stream.XMLStreamReader in, Specification specification)
           
 void readFromXML(javax.xml.stream.XMLStreamReader in, Specification specification)
           
 void setFeatureContainer(FeatureContainer newFeatureContainer)
          Set the FeatureContainer value.
 void setIndex(int index)
           
 java.lang.String toString()
          Use only for debugging purposes! A human-readable and localized name is returned by getName().
 
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAttribute, getAttribute, getAttribute, getAttribute, getId, getPropertyChangeListeners, getPropertyChangeListeners, getXMLElementTagName, hasAttribute, hasListeners, readFromXML, readFromXMLElement, removePropertyChangeListener, removePropertyChangeListener, toXML, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, writeAttribute, writeFreeColGameObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FreeColGameObjectType

public FreeColGameObjectType()

FreeColGameObjectType

public FreeColGameObjectType(java.lang.String id)
Method Detail

getFeatureContainer

public final FeatureContainer getFeatureContainer()
Get the FeatureContainer value.

Returns:
a FeatureContainer value

setFeatureContainer

public final void setFeatureContainer(FeatureContainer newFeatureContainer)
Set the FeatureContainer value.

Parameters:
newFeatureContainer - The new FeatureContainer value.

setIndex

public final void setIndex(int index)

getIndex

public final int getIndex()

hasAbility

public boolean hasAbility(java.lang.String id)
Description copied from class: FreeColObject
Describe hasAbility method here.

Overrides:
hasAbility in class FreeColObject
Parameters:
id - a String value
Returns:
a boolean value

hasAbility

public boolean hasAbility(java.lang.String id,
                          FreeColGameObjectType type)

addAbility

public void addAbility(Ability ability)

addModifier

public void addModifier(Modifier modifier)

getModifierSet

public java.util.Set<Modifier> getModifierSet(java.lang.String id)

readFromXML

public void readFromXML(javax.xml.stream.XMLStreamReader in,
                        Specification specification)
                 throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

readChildren

public void readChildren(javax.xml.stream.XMLStreamReader in,
                         Specification specification)
                  throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

toString

public java.lang.String toString()
Use only for debugging purposes! A human-readable and localized name is returned by getName().

Overrides:
toString in class java.lang.Object