|
|||||||||
| 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.BuildableType
net.sf.freecol.common.model.EquipmentType
public class EquipmentType
| Field Summary | |
|---|---|
private boolean |
captureEquipmentByIndians
|
private java.lang.String |
captureEquipmentId
What this equipment type becomes if it is captured by Indians (if captureEquipmentByIndians is true) or Europeans (otherwise). |
private int |
combatLossPriority
Determines which type of Equipment will be lost first if the Unit carrying it is defeated. |
private java.util.List<java.lang.String> |
compatibleEquipment
A List containing the IDs of equipment types compatible with this one. |
private int |
maximumCount
The maximum number of equipment items that can be combined. |
private boolean |
militaryEquipment
Describe militaryEquipment here. |
static EquipmentType[] |
NO_EQUIPMENT
|
private Unit.Role |
role
The default Role of the Unit carrying this type of Equipment. |
| Fields inherited from class net.sf.freecol.common.model.BuildableType |
|---|
NOTHING |
| 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 | |
|---|---|
EquipmentType(java.lang.String id,
Specification specification)
|
|
| Method Summary | |
|---|---|
boolean |
canBeCaptured()
Returns true if this EquipmentType can be captured in combat. |
boolean |
equals(java.lang.Object obj)
|
EquipmentType |
getCaptureEquipment(boolean byIndians)
Get the type of equipment to capture, handling the case where Europeans and Indians use different EquipmentTypes
for the same underlying goods. |
int |
getCombatLossPriority()
Get the CombatLossPriority value. |
int |
getMaximumCount()
Get the MaximumCount value. |
Unit.Role |
getRole()
Get the Role value. |
java.util.Map<java.lang.String,java.lang.Boolean> |
getUnitAbilitiesRequired()
Returns the abilities required by this Type. |
static java.lang.String |
getXMLElementTagName()
Returns the tag name of the root element representing this object. |
int |
hashCode()
|
boolean |
isCompatibleWith(EquipmentType otherType)
Returns true if this type of equipment is compatible with the given type of equipment. |
boolean |
isMilitaryEquipment()
Returns true if Equipment of this type grants an offence bonus or a defence bonus. |
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. |
protected void |
readChildren(javax.xml.stream.XMLStreamReader in)
Reads the children of this object from an XML stream. |
void |
setCombatLossPriority(int newCombatLossPriority)
Set the CombatLossPriority value. |
void |
setMaximumCount(int newMaximumCount)
Set the MaximumCount value. |
void |
setMilitaryEquipment(boolean newMilitaryEquipment)
Set the MilitaryEquipment value. |
void |
setRole(Unit.Role newRole)
Set the Role value. |
protected void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out)
Makes an XML-representation of this object. |
protected 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. |
| Methods inherited from class net.sf.freecol.common.model.BuildableType |
|---|
getAbilitiesRequired, getAmountRequiredOf, getGoodsRequired, getLimits, getPopulationRequired, needsGoodsToBuild, setGoodsRequired, setLimits, setPopulationRequired |
| Methods inherited from class net.sf.freecol.common.model.FreeColGameObjectType |
|---|
addAbility, addModifier, applyDifficultyLevel, getDescriptionKey, getFeatureContainer, getIndex, getModifierIndex, getModifierIndex, getModifierSet, getNameKey, hasAbility, hasAbility, isAbstractType, setAbstractType, setFeatureContainer, setIndex, setModifierIndex, toString, toXMLImpl |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final EquipmentType[] NO_EQUIPMENT
private int maximumCount
private int combatLossPriority
private java.lang.String captureEquipmentId
private boolean captureEquipmentByIndians
private Unit.Role role
private boolean militaryEquipment
private java.util.List<java.lang.String> compatibleEquipment
| Constructor Detail |
|---|
public EquipmentType(java.lang.String id,
Specification specification)
| Method Detail |
|---|
public final int getMaximumCount()
MaximumCount value.
int valuepublic final void setMaximumCount(int newMaximumCount)
MaximumCount value.
newMaximumCount - The new MaximumCount value.public final Unit.Role getRole()
Role value.
Role valuepublic final void setRole(Unit.Role newRole)
Role value.
newRole - The new Role value.public final int getCombatLossPriority()
CombatLossPriority value.
int valuepublic final void setCombatLossPriority(int newCombatLossPriority)
CombatLossPriority value.
newCombatLossPriority - The new CombatLossPriority value.public boolean canBeCaptured()
boolean valuepublic EquipmentType getCaptureEquipment(boolean byIndians)
EquipmentTypes
for the same underlying goods.
byIndians - is the capture by the Indians?
EquipmentType valuepublic java.util.Map<java.lang.String,java.lang.Boolean> getUnitAbilitiesRequired()
public boolean isCompatibleWith(EquipmentType otherType)
otherType - an EquipmentType value
boolean valuepublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic final boolean isMilitaryEquipment()
boolean valuepublic final void setMilitaryEquipment(boolean newMilitaryEquipment)
MilitaryEquipment value.
newMilitaryEquipment - The new MilitaryEquipment value.
protected 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.
protected void writeAttributes(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
writeAttributes in class BuildableTypeout - 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 BuildableTypeout - 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 FreeColGameObjectTypein - 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 FreeColGameObjectTypein - 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 BuildableTypein - 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 | ||||||||