public abstract class FreeColGameObjectType extends FreeColObject implements Named
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
ABSTRACT_TAG |
private boolean |
abstractType
Whether the type is abstract, or can be instantiated.
|
protected static java.lang.String |
DELETE_TAG |
static java.lang.String |
EXTENDS_TAG |
private FeatureContainer |
featureContainer
The features of this game object type.
|
private int |
index
The index imposes a total ordering consistent with equals on
each class extending FreeColGameObjectType, but this ordering
is nothing but the order in which the objects of the respective
class were defined.
|
static java.lang.String |
PRESERVE_TAG |
ARRAY_SIZE_TAG, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, INFINITY, logger, UNDEFINED, VALUE_TAG| Modifier | Constructor and Description |
|---|---|
protected |
FreeColGameObjectType()
Deliberately empty constructor.
|
|
FreeColGameObjectType(Specification specification)
Create a FreeColGameObjectType with a given specification but
no object identifier.
|
|
FreeColGameObjectType(java.lang.String id)
Create a simple FreeColGameObjectType without a specification.
|
|
FreeColGameObjectType(java.lang.String id,
Specification specification)
Create a FreeColGameObjectType with a given identifier and
specification.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDescriptionKey()
Gets a string suitable for looking up the description of
this object in
Messages. |
FeatureContainer |
getFeatureContainer()
Gets the feature container.
|
protected int |
getIndex()
Gets the index of this FreeColGameObjectType.
|
java.lang.String |
getNameKey()
Gets the name of this named object.
|
boolean |
isAbstractType()
Is this an abstract type?
|
protected void |
readAttributes(FreeColXMLReader xr)
Reads the attributes of this object from an XML stream.
|
protected void |
readChild(FreeColXMLReader xr)
Reads a single child object.
|
protected void |
readChildren(FreeColXMLReader xr)
Reads the children of this object from an XML stream.
|
protected void |
setIndex(int index)
Sets the index of this FreeColGameObjectType.
|
java.lang.String |
toString() |
protected void |
writeChildren(FreeColXMLWriter xw)
Write the children of this object to a stream.
|
addAbility, addFeatures, addModifier, addPropertyChangeListener, addPropertyChangeListener, applyModifiers, applyModifiers, applyModifiers, compareIds, compareTo, containsAbilityKey, containsModifierKey, copy, dumpCollection, dumpObject, equals, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAbilities, getAbilities, getAbilities, getAbilities, getDefenceModifiers, getId, getIdNumber, getIdType, getIdType, getModifiers, getModifiers, getModifiers, getModifiers, getPropertyChangeListeners, getPropertyChangeListeners, getSortedAbilities, getSortedCopy, getSortedModifiers, getSpecification, getSuffix, getSuffix, getXMLElementTagName, getXMLTagName, hasAbility, hasAbility, hasAbility, hashCode, hasListeners, hasModifier, hasModifier, hasModifier, internId, invokeMethod, logFreeColObjects, readFromXML, readFromXMLElement, readFromXMLPartial, readId, removeAbilities, removeAbility, removeFeatures, removeModifier, removeModifiers, removePropertyChangeListener, removePropertyChangeListener, save, save, save, save, serialize, serialize, setId, setSpecification, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, toXMLPartial, writeAttributesprivate boolean abstractType
private FeatureContainer featureContainer
private int index
private static final java.lang.String ABSTRACT_TAG
protected static final java.lang.String DELETE_TAG
public static final java.lang.String EXTENDS_TAG
public static final java.lang.String PRESERVE_TAG
protected FreeColGameObjectType()
public FreeColGameObjectType(java.lang.String id)
id - The object identifier.public FreeColGameObjectType(Specification specification)
specification - The Specification to refer to.public FreeColGameObjectType(java.lang.String id,
Specification specification)
id - The object identifier.specification - The Specification to refer to.public final FeatureContainer getFeatureContainer()
getFeatureContainer in class FreeColObjectFeatureContainer.protected int getIndex()
protected final void setIndex(int index)
index - The new index value.public final java.lang.String getDescriptionKey()
Messages.public final boolean isAbstractType()
public final java.lang.String getNameKey()
getNameKey in interface NamedNamed.protected void writeChildren(FreeColXMLWriter xw) throws javax.xml.stream.XMLStreamException
writeChildren in class FreeColObjectxw - The FreeColXMLWriter to write to.javax.xml.stream.XMLStreamException - if there are any problems writing
to the stream.protected void readAttributes(FreeColXMLReader xr) throws javax.xml.stream.XMLStreamException
readAttributes in class FreeColObjectxr - The FreeColXMLReader to read from.javax.xml.stream.XMLStreamException - if there is a problem reading the stream.protected void readChildren(FreeColXMLReader xr) throws javax.xml.stream.XMLStreamException
readChildren in class FreeColObjectxr - The FreeColXMLReader to read from.javax.xml.stream.XMLStreamException - if there is a problem reading the stream.protected void readChild(FreeColXMLReader xr) throws javax.xml.stream.XMLStreamException
readChild in class FreeColObjectxr - The FreeColXMLReader to read from.javax.xml.stream.XMLStreamException - if there is a problem reading the stream.public java.lang.String toString()
toString in class FreeColObject