Package net.sf.freecol.common.model
Class NationSummary
- java.lang.Object
-
- net.sf.freecol.common.model.FreeColObject
-
- net.sf.freecol.common.model.NationSummary
-
- All Implemented Interfaces:
java.lang.Comparable<FreeColObject>
,ObjectWithId
public class NationSummary extends FreeColObject
A container class summarizing an enemy nation.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
FOUNDING_FATHERS_TAG
private int
foundingFathers
The number of founding fathers this (European) player has.private int
gold
The gold this (European) player has.private static java.lang.String
GOLD_TAG
private static java.lang.String
MILITARY_STRENGTH_TAG
private int
militaryStrength
The military strength of this (European) player.private static java.lang.String
NAVAL_STRENGTH_TAG
private int
navalStrength
The naval strength of this (European) player.private static java.lang.String
NUMBER_OF_SETTLEMENTS_TAG
private static java.lang.String
NUMBER_OF_UNITS_TAG
private int
numberOfSettlements
The number of settlements this player has.private int
numberOfUnits
The number of units this (European) player has.private int
soL
The (European) player SoL.private static java.lang.String
SOL_TAG
private Stance
stance
The stance of the player toward the requesting player.private static java.lang.String
STANCE_TAG
static java.lang.String
TAG
private int
tax
The tax rate of this (European) player.private static java.lang.String
TAX_TAG
-
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ARRAY_SIZE_TAG, DEFAULT_CLASS_INDEX, fcoComparator, ID_ATTRIBUTE_TAG, logger, PARTIAL_ATTRIBUTE_TAG, VALUE_TAG
-
-
Constructor Summary
Constructors Constructor Description NationSummary()
Trivial constructor allowing creation by Game.newInstance().NationSummary(Player player, Player requester)
Creates a nation summary for the specified player.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends FreeColObject>
booleancopyIn(T other)
Copy another FreeColObject into this one if it is compatible.int
getFoundingFathers()
int
getGold()
int
getMilitaryStrength()
int
getNavalStrength()
int
getNumberOfSettlements()
int
getNumberOfUnits()
int
getSoL()
Stance
getStance()
int
getTax()
java.lang.String
getXMLTagName()
Get the serialization tag for this object.protected void
readAttributes(FreeColXMLReader xr)
Reads the attributes of this object from an XML stream.protected void
writeAttributes(FreeColXMLWriter xw)
Write the attributes of this object to a stream.-
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addAbility, addFeatures, addModifier, addPropertyChangeListener, addPropertyChangeListener, apply, apply, applyModifiers, applyModifiers, arrayKey, compareIds, compareTo, containsAbilityKey, containsModifierKey, copy, copy, copy, copy, copyInCast, dumpObject, equals, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAbilities, getAbilities, getAbilities, getAbilities, getClassIndex, getDefenceModifiers, getDisplayObject, getFeatureContainer, getFreeColObjectClass, getFreeColObjectClassByName, getGame, getId, getIdNumber, getIdType, getIdTypeByName, getModifiers, getModifiers, getModifiers, getModifiers, getObjectClassIndex, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getSortedAbilities, getSortedModifiers, getSpecification, getSuffix, getSuffix, hasAbility, hasAbility, hasAbility, hashCode, hasListeners, hasModifier, hasModifier, hasModifier, idEquals, invokeMethod, logFreeColObjects, readChild, readChildren, readFromXML, readFromXMLPartial, removeAbilities, removeAbility, removeFeatures, removeModifier, removeModifiers, removePropertyChangeListener, removePropertyChangeListener, save, save, save, save, serialize, serialize, serialize, serialize, setGame, setId, setSpecification, toString, toXML, toXML, toXMLPartial, toXMLPartial, writeChildren
-
-
-
-
Field Detail
-
TAG
public static final java.lang.String TAG
- See Also:
- Constant Field Values
-
stance
private Stance stance
The stance of the player toward the requesting player.
-
numberOfSettlements
private int numberOfSettlements
The number of settlements this player has.
-
numberOfUnits
private int numberOfUnits
The number of units this (European) player has.
-
militaryStrength
private int militaryStrength
The military strength of this (European) player.
-
navalStrength
private int navalStrength
The naval strength of this (European) player.
-
gold
private int gold
The gold this (European) player has.
-
soL
private int soL
The (European) player SoL.
-
foundingFathers
private int foundingFathers
The number of founding fathers this (European) player has.
-
tax
private int tax
The tax rate of this (European) player.
-
FOUNDING_FATHERS_TAG
private static final java.lang.String FOUNDING_FATHERS_TAG
- See Also:
- Constant Field Values
-
GOLD_TAG
private static final java.lang.String GOLD_TAG
- See Also:
- Constant Field Values
-
MILITARY_STRENGTH_TAG
private static final java.lang.String MILITARY_STRENGTH_TAG
- See Also:
- Constant Field Values
-
NAVAL_STRENGTH_TAG
private static final java.lang.String NAVAL_STRENGTH_TAG
- See Also:
- Constant Field Values
-
NUMBER_OF_SETTLEMENTS_TAG
private static final java.lang.String NUMBER_OF_SETTLEMENTS_TAG
- See Also:
- Constant Field Values
-
NUMBER_OF_UNITS_TAG
private static final java.lang.String NUMBER_OF_UNITS_TAG
- See Also:
- Constant Field Values
-
SOL_TAG
private static final java.lang.String SOL_TAG
- See Also:
- Constant Field Values
-
STANCE_TAG
private static final java.lang.String STANCE_TAG
- See Also:
- Constant Field Values
-
TAX_TAG
private static final java.lang.String TAX_TAG
- See Also:
- Constant Field Values
-
-
Method Detail
-
getStance
public Stance getStance()
-
getNumberOfSettlements
public int getNumberOfSettlements()
-
getNumberOfUnits
public int getNumberOfUnits()
-
getMilitaryStrength
public int getMilitaryStrength()
-
getNavalStrength
public int getNavalStrength()
-
getGold
public int getGold()
-
getFoundingFathers
public int getFoundingFathers()
-
getSoL
public int getSoL()
-
getTax
public int getTax()
-
copyIn
public <T extends FreeColObject> boolean copyIn(T other)
Copy another FreeColObject into this one if it is compatible.- Overrides:
copyIn
in classFreeColObject
- Type Parameters:
T
- TheFreeColObject
subclass of the object to copy in.- Parameters:
other
- The other object.- Returns:
- True if the copy in is succesful.
-
writeAttributes
protected void writeAttributes(FreeColXMLWriter xw) throws javax.xml.stream.XMLStreamException
Write the attributes of this object to a stream. To be overridden if required by any object that has attributes and uses the toXML(FreeColXMLWriter, String) call.- Overrides:
writeAttributes
in classFreeColObject
- Parameters:
xw
- TheFreeColXMLWriter
to write to.- Throws:
javax.xml.stream.XMLStreamException
- if there are any problems writing to the stream.
-
readAttributes
protected void readAttributes(FreeColXMLReader xr) throws javax.xml.stream.XMLStreamException
Reads the attributes of this object from an XML stream.- Overrides:
readAttributes
in classFreeColObject
- Parameters:
xr
- TheFreeColXMLReader
to read from.- Throws:
javax.xml.stream.XMLStreamException
- if there is a problem reading the stream.
-
getXMLTagName
public java.lang.String getXMLTagName()
Get the serialization tag for this object.- Specified by:
getXMLTagName
in classFreeColObject
- Returns:
- The tag.
-
-