net.sf.freecol.common.model
Class EquipmentType

java.lang.Object
  extended by net.sf.freecol.common.model.FreeColObject
      extended by net.sf.freecol.common.model.FreeColGameObjectType
          extended by net.sf.freecol.common.model.BuildableType
              extended by net.sf.freecol.common.model.EquipmentType

public class EquipmentType
extends BuildableType


Field Summary
static EquipmentType[] NO_EQUIPMENT
           
 
Fields inherited from class net.sf.freecol.common.model.BuildableType
NOTHING, UNDEFINED
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ID_ATTRIBUTE_TAG
 
Constructor Summary
EquipmentType()
           
EquipmentType(int index)
           
 
Method Summary
 boolean canBeCaptured()
          Returns true if this EquipmentType can be captured in combat.
 int getCombatLossPriority()
          Get the CombatLossPriority value.
 java.util.Map<java.lang.String,java.lang.Boolean> getLocationAbilitiesRequired()
          Returns the abilities required by this Type.
 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.
 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.
 void readAttributes(javax.xml.stream.XMLStreamReader in, Specification specification)
           
 void readChildren(javax.xml.stream.XMLStreamReader in, Specification specification)
           
 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.
 
Methods inherited from class net.sf.freecol.common.model.BuildableType
getAbilitiesRequired, getAmountRequiredOf, getGoodsRequired, getGoodsRequiredAsString, getPopulationRequired, setGoodsRequired, setPopulationRequired
 
Methods inherited from class net.sf.freecol.common.model.FreeColGameObjectType
addAbility, addModifier, getFeatureContainer, getIndex, getModifierSet, hasAbility, hasAbility, readFromXML, setFeatureContainer, setIndex, toString
 
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAttribute, getAttribute, getAttribute, getAttribute, getId, getPropertyChangeListeners, getPropertyChangeListeners, getXMLElementTagName, hasAttribute, hasListeners, readFromXML, readFromXMLElement, removePropertyChangeListener, removePropertyChangeListener, toXML, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, writeAttribute, writeFreeColGameObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_EQUIPMENT

public static final EquipmentType[] NO_EQUIPMENT
Constructor Detail

EquipmentType

public EquipmentType()

EquipmentType

public EquipmentType(int index)
Method Detail

getMaximumCount

public final int getMaximumCount()
Get the MaximumCount value.

Returns:
an int value

setMaximumCount

public final void setMaximumCount(int newMaximumCount)
Set the MaximumCount value.

Parameters:
newMaximumCount - The new MaximumCount value.

getRole

public final Unit.Role getRole()
Get the Role value.

Returns:
a Role value

setRole

public final void setRole(Unit.Role newRole)
Set the Role value.

Parameters:
newRole - The new Role value.

getCombatLossPriority

public final int getCombatLossPriority()
Get the CombatLossPriority value.

Returns:
an int value

canBeCaptured

public boolean canBeCaptured()
Returns true if this EquipmentType can be captured in combat.

Returns:
a boolean value

setCombatLossPriority

public final void setCombatLossPriority(int newCombatLossPriority)
Set the CombatLossPriority value.

Parameters:
newCombatLossPriority - The new CombatLossPriority value.

getUnitAbilitiesRequired

public java.util.Map<java.lang.String,java.lang.Boolean> getUnitAbilitiesRequired()
Returns the abilities required by this Type.

Returns:
the abilities required by this Type.

getLocationAbilitiesRequired

public java.util.Map<java.lang.String,java.lang.Boolean> getLocationAbilitiesRequired()
Returns the abilities required by this Type.

Returns:
the abilities required by this Type.

isCompatibleWith

public boolean isCompatibleWith(EquipmentType otherType)
Returns true if this type of equipment is compatible with the given type of equipment.

Parameters:
otherType - an EquipmentType value
Returns:
a boolean value

isMilitaryEquipment

public final boolean isMilitaryEquipment()
Returns true if Equipment of this type grants an offence bonus or a defence bonus.

Returns:
a boolean value

setMilitaryEquipment

public final void setMilitaryEquipment(boolean newMilitaryEquipment)
Set the MilitaryEquipment value.

Parameters:
newMilitaryEquipment - The new MilitaryEquipment value.

readAttributes

public void readAttributes(javax.xml.stream.XMLStreamReader in,
                           Specification specification)
                    throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

readChildren

public void readChildren(javax.xml.stream.XMLStreamReader in,
                         Specification specification)
                  throws javax.xml.stream.XMLStreamException
Overrides:
readChildren in class FreeColGameObjectType
Throws:
javax.xml.stream.XMLStreamException