|
|||||||||
| 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
net.sf.freecol.common.model.NationType
net.sf.freecol.common.model.EuropeanNationType
public class EuropeanNationType
Represents one of the European nations present in the game, i.e. both REFs and possible human players.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class net.sf.freecol.common.model.NationType |
|---|
NationType.AggressionLevel, NationType.SettlementNumber |
| Field Summary | |
|---|---|
private boolean |
ref
Whether this is an REF Nation. |
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,AbstractUnit>> |
startingUnitMap
Stores the starting units of this Nation at various difficulties. |
private java.util.List<AbstractUnit> |
startingUnits
Stores the starting units of this Nation. |
| 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 | |
|---|---|
EuropeanNationType(java.lang.String id,
Specification specification)
|
|
| Method Summary | |
|---|---|
void |
applyDifficultyLevel(OptionGroup difficulty)
Applies the difficulty level to this nation type. |
java.util.List<AbstractUnit> |
getStartingUnits()
Returns a list of this Nation's starting units. |
java.util.List<AbstractUnit> |
getStartingUnits(java.lang.String key)
Returns a list of this Nation's starting units at the given difficulty. |
static java.lang.String |
getXMLElementTagName()
Returns the tag name of the root element representing this object. |
boolean |
isEuropean()
Returns true. |
boolean |
isIndian()
Returns false. |
boolean |
isREF()
Get the REF 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 child object. |
void |
setREF(boolean newREF)
Set the REF value. |
void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out)
Makes an XML-representation of this object. |
void |
writeAttributes(javax.xml.stream.XMLStreamWriter out)
Write the attributes of this object to a stream. |
protected void |
writeChildren(javax.xml.stream.XMLStreamWriter out)
Write the children of this object to a stream. |
private void |
writeUnit(javax.xml.stream.XMLStreamWriter out,
java.lang.String id,
AbstractUnit unit,
boolean expert)
|
| Methods inherited from class net.sf.freecol.common.model.NationType |
|---|
getAggression, getCapitalType, getNumberOfSettlements, getSettlementType, getSettlementType, getSettlementTypes, setAggression, setNumberOfSettlements |
| Methods inherited from class net.sf.freecol.common.model.FreeColGameObjectType |
|---|
addAbility, addModifier, getDescriptionKey, getFeatureContainer, getIndex, getModifierIndex, getModifierIndex, getModifierSet, getNameKey, hasAbility, hasAbility, isAbstractType, readChildren, setAbstractType, setFeatureContainer, setIndex, setModifierIndex, toString, toXMLImpl |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private boolean ref
private java.util.List<AbstractUnit> startingUnits
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,AbstractUnit>> startingUnitMap
| Constructor Detail |
|---|
public EuropeanNationType(java.lang.String id,
Specification specification)
| Method Detail |
|---|
public final boolean isREF()
REF value.
isREF in class NationTypeboolean valuepublic final void setREF(boolean newREF)
REF value.
newREF - The new REF value.public boolean isEuropean()
isEuropean in class NationTypeboolean valuepublic boolean isIndian()
isIndian in class NationTypeboolean valuepublic java.util.List<AbstractUnit> getStartingUnits()
public java.util.List<AbstractUnit> getStartingUnits(java.lang.String key)
key - the value of the expert-starting-units field
public void applyDifficultyLevel(OptionGroup difficulty)
applyDifficultyLevel in class FreeColGameObjectTypedifficulty - difficulty level to apply
public void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
toXMLImpl in class FreeColGameObjectTypeout - The output stream.
javax.xml.stream.XMLStreamException - if there are any problems writing to the
stream.
public void writeAttributes(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
writeAttributes in class NationTypeout - 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 NationTypeout - The target stream.
javax.xml.stream.XMLStreamException - if there are any problems writing to
the stream.
private void writeUnit(javax.xml.stream.XMLStreamWriter out,
java.lang.String id,
AbstractUnit unit,
boolean expert)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected void readAttributes(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
readAttributes in class NationTypein - 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 NationTypein - The XML stream to read.
javax.xml.stream.XMLStreamException - if an error occurspublic static java.lang.String getXMLElementTagName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||