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.StringFOUNDING_FATHERS_TAGprivate intfoundingFathersThe number of founding fathers this (European) player has.private intgoldThe gold this (European) player has.private static java.lang.StringGOLD_TAGprivate static java.lang.StringMILITARY_STRENGTH_TAGprivate intmilitaryStrengthThe military strength of this (European) player.private static java.lang.StringNAVAL_STRENGTH_TAGprivate intnavalStrengthThe naval strength of this (European) player.private static java.lang.StringNUMBER_OF_SETTLEMENTS_TAGprivate static java.lang.StringNUMBER_OF_UNITS_TAGprivate intnumberOfSettlementsThe number of settlements this player has.private intnumberOfUnitsThe number of units this (European) player has.private intsoLThe (European) player SoL.private static java.lang.StringSOL_TAGprivate StancestanceThe stance of the player toward the requesting player.private static java.lang.StringSTANCE_TAGstatic java.lang.StringTAGprivate inttaxThe tax rate of this (European) player.private static java.lang.StringTAX_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.intgetFoundingFathers()intgetGold()intgetMilitaryStrength()intgetNavalStrength()intgetNumberOfSettlements()intgetNumberOfUnits()intgetSoL()StancegetStance()intgetTax()java.lang.StringgetXMLTagName()Get the serialization tag for this object.protected voidreadAttributes(FreeColXMLReader xr)Reads the attributes of this object from an XML stream.protected voidwriteAttributes(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:
copyInin classFreeColObject- Type Parameters:
T- TheFreeColObjectsubclass 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:
writeAttributesin classFreeColObject- Parameters:
xw- TheFreeColXMLWriterto 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:
readAttributesin classFreeColObject- Parameters:
xr- TheFreeColXMLReaderto 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:
getXMLTagNamein classFreeColObject- Returns:
- The tag.
-
-