|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.common.model.FreeColObject
net.sf.freecol.common.model.FreeColGameObjectType
public class FreeColGameObjectType
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 | |
|---|---|
private boolean |
abstractType
Whether the type is abstract or can be instantiated. |
private FeatureContainer |
featureContainer
Describe featureContainer here. |
private int |
index
|
private int |
modifierIndex
The default index of Modifiers provided by this type. |
| Fields inherited from class net.sf.freecol.common.model.FreeColObject |
|---|
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, INFINITY, logger, NO_ID, PARTIAL_ATTRIBUTE, UNDEFINED, VALUE_TAG |
| Constructor Summary | |
|---|---|
protected |
FreeColGameObjectType()
|
|
FreeColGameObjectType(Specification specification)
|
|
FreeColGameObjectType(java.lang.String id)
|
|
FreeColGameObjectType(java.lang.String id,
Specification specification)
|
| Method Summary | |
|---|---|
void |
addAbility(Ability ability)
|
void |
addModifier(Modifier modifier)
|
void |
applyDifficultyLevel(OptionGroup difficulty)
Applies the difficulty level with the given ID to this FreeColGameObjectType. |
java.lang.String |
getDescriptionKey()
|
FeatureContainer |
getFeatureContainer()
Get the FeatureContainer value. |
protected int |
getIndex()
Returns the index of this FreeColGameObjectType. |
int |
getModifierIndex()
Get the ModifierIndex value. |
int |
getModifierIndex(Modifier modifier)
Get the index for the given Modifier. |
java.util.Set<Modifier> |
getModifierSet(java.lang.String id)
|
java.lang.String |
getNameKey()
|
boolean |
hasAbility(java.lang.String id)
Describe hasAbility method here. |
boolean |
hasAbility(java.lang.String id,
FreeColGameObjectType type)
|
boolean |
isAbstractType()
Get the Abstract value. |
protected void |
readAttributes(javax.xml.stream.XMLStreamReader in)
Reads the attributes of this object from an XML stream. |
protected void |
readChild(javax.xml.stream.XMLStreamReader in)
Reads a common child object, i.e. |
protected void |
readChildren(javax.xml.stream.XMLStreamReader in)
Reads the children of this object from an XML stream. |
void |
setAbstractType(boolean newAbstract)
Set the Abstract value. |
void |
setFeatureContainer(FeatureContainer newFeatureContainer)
Set the FeatureContainer value. |
protected void |
setIndex(int index)
Describe setIndex method here. |
void |
setModifierIndex(int newModifierIndex)
Set the ModifierIndex value. |
java.lang.String |
toString()
Use only for debugging purposes! A human-readable and localized name is returned by getName(). |
protected void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out)
This method writes an XML-representation of this object to the given stream. |
protected void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out,
java.lang.String tag)
This method writes an XML-representation of this object to the given stream. |
protected void |
writeChildren(javax.xml.stream.XMLStreamWriter out)
Write the children of this object to a stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private int index
private int modifierIndex
private boolean abstractType
private FeatureContainer featureContainer
| Constructor Detail |
|---|
protected FreeColGameObjectType()
public FreeColGameObjectType(java.lang.String id)
public FreeColGameObjectType(Specification specification)
public FreeColGameObjectType(java.lang.String id,
Specification specification)
| Method Detail |
|---|
public final FeatureContainer getFeatureContainer()
FeatureContainer value.
FeatureContainer valuepublic final void setFeatureContainer(FeatureContainer newFeatureContainer)
FeatureContainer value.
newFeatureContainer - The new FeatureContainer value.protected final void setIndex(int index)
setIndex method here.
index - an int valueprotected int getIndex()
int valuepublic final java.lang.String getNameKey()
public final java.lang.String getDescriptionKey()
public boolean hasAbility(java.lang.String id)
FreeColObjecthasAbility method here.
hasAbility in class FreeColObjectid - a String value
boolean value
public boolean hasAbility(java.lang.String id,
FreeColGameObjectType type)
public void addAbility(Ability ability)
public void addModifier(Modifier modifier)
public java.util.Set<Modifier> getModifierSet(java.lang.String id)
public void applyDifficultyLevel(OptionGroup difficulty)
difficulty - difficulty level to applypublic final int getModifierIndex()
ModifierIndex value.
int valuepublic int getModifierIndex(Modifier modifier)
modifier - a Modifier value
int valuepublic final void setModifierIndex(int newModifierIndex)
ModifierIndex value.
newModifierIndex - The new ModifierIndex value.public final boolean isAbstractType()
Abstract value.
boolean valuepublic final void setAbstractType(boolean newAbstract)
Abstract value.
newAbstract - The new Abstract value.
protected void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
FreeColObject
toXMLImpl in class FreeColObjectout - The target stream.
javax.xml.stream.XMLStreamException - if there are any problems writing
to the stream.
protected void toXMLImpl(javax.xml.stream.XMLStreamWriter out,
java.lang.String tag)
throws javax.xml.stream.XMLStreamException
out - The target stream.
javax.xml.stream.XMLStreamException - if there are any problems writing
to the stream.
protected void writeChildren(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
writeChildren in class FreeColObjectout - The target stream.
javax.xml.stream.XMLStreamException - if there are any problems writing
to the stream.
protected void readAttributes(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
readAttributes in class FreeColObjectin - The XML input stream.
javax.xml.stream.XMLStreamException - if a problem was encountered
during parsing.
protected void readChildren(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
readChildren in class FreeColObjectin - The XML input stream.
javax.xml.stream.XMLStreamException - if a problem was encountered
during parsing.
protected void readChild(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
readChild in class FreeColObjectin - The XML input stream.
javax.xml.stream.XMLStreamException - if an error occurspublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||