|
|||||||||
| 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.UnitType
public final class UnitType
| Field Summary | |
|---|---|
static int |
DEFAULT_DEFENCE
|
static int |
DEFAULT_OFFENCE
|
private EquipmentType |
defaultEquipment
Describe defaultEquipment here. |
private int |
defence
Describe defence here. |
private GoodsType |
expertProduction
Describe expertProduction here. |
static int |
FOOD_CONSUMPTION
|
private int |
foodConsumed
Describe foodConsumed here. |
private int |
hitPoints
Describe hitPoints here. |
private int |
lineOfSight
Describe lineOfSight here. |
private int |
maximumAttrition
Describe maximumAttrition here. |
private int |
movement
Describe movement here. |
private int |
offence
Describe offence here. |
private java.lang.String |
pathImage
Describe pathImage here. |
private int |
price
Describe price here. |
private int |
recruitProbability
Describe recruitProbability here. |
private int |
scoreValue
How much a Unit of this type contributes to the Player's score. |
private int |
skill
Describe skill here. |
private java.lang.String |
skillTaught
The ID of the skill this UnitType teaches, mostly its own. |
private int |
space
Describe space here. |
private int |
spaceTaken
Describe spaceTaken here. |
private java.util.List<UnitTypeChange> |
typeChanges
The possible type changes for this unit type. |
| Fields inherited from class net.sf.freecol.common.model.BuildableType |
|---|
NOTHING, UNDEFINED |
| Fields inherited from class net.sf.freecol.common.model.FreeColGameObjectType |
|---|
featureContainer |
| Fields inherited from class net.sf.freecol.common.model.FreeColObject |
|---|
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, logger, PARTIAL_ATTRIBUTE |
| Constructor Summary | |
|---|---|
UnitType()
|
|
UnitType(int index)
Creates a new UnitType instance. |
|
| Method Summary | |
|---|---|
boolean |
canBeBuilt()
Returns true if this UnitType can be built. |
boolean |
canBeUpgraded(UnitType newType,
UnitTypeChange.ChangeType changeType)
Return true if this UnitType can be upgraded to the given UnitType by the given means of education. |
boolean |
canCarryGoods()
Returns true if Units of this type can carry Goods. |
boolean |
canCarryUnits()
Returns true if Units of this type can carry other Units. |
EquipmentType[] |
getDefaultEquipment()
|
EquipmentType |
getDefaultEquipmentType()
Get the DefaultEquipment value. |
int |
getDefence()
Get the Defence value. |
int |
getEducationTurns(UnitType unitType)
Get the EducationTurns value. |
UnitType |
getEducationUnit(int maximumSkill)
Get a UnitType to learn with a level skill less or equal than given level |
GoodsType |
getExpertProduction()
Get the ExpertProduction value. |
int |
getFoodConsumed()
Returns the amount of food this unit type consumes per turn. |
int |
getHitPoints()
Get the HitPoints value. |
int |
getLineOfSight()
Get the LineOfSight value. |
int |
getMaximumAttrition()
Get the MaximumAttrition value. |
int |
getMovement()
Get the Movement value. |
int |
getOffence()
Get the Offence value. |
java.lang.String |
getPathImage()
Get the PathImage value. |
int |
getPrice()
Get the Price value. |
int |
getProductionFor(GoodsType goodsType,
int base)
|
int |
getRecruitProbability()
Get the RecruitProbability value. |
int |
getScoreValue()
Get the ScoreValue value. |
int |
getSkill()
Get the Skill value. |
java.lang.String |
getSkillTaught()
Get the SkillTaught value. |
int |
getSpace()
Get the Space value. |
int |
getSpaceTaken()
Get the SpaceTaken value. |
java.util.List<UnitTypeChange> |
getTypeChanges()
|
UnitType |
getUnitTypeChange(UnitTypeChange.ChangeType changeType,
Player player)
Describe getUnitTypeChange method here. |
java.util.List<UnitType> |
getUnitTypesLearntInLostCity()
Get a list of UnitType which can learn in a lost city rumour |
boolean |
hasPrice()
Returns true if this UnitType has a price. |
boolean |
hasSkill()
Returns true if this UnitType has a skill. |
boolean |
isAvailableTo(Player player)
Returns true if the UnitType is available to the given Player. |
boolean |
isRecruitable()
If this UnitType is recruitable in Europe |
void |
readAttributes(javax.xml.stream.XMLStreamReader in,
Specification specification)
|
void |
readChildren(javax.xml.stream.XMLStreamReader in,
Specification specification)
|
void |
setDefaultEquipmentType(EquipmentType newDefaultEquipment)
Set the DefaultEquipment value. |
void |
setDefence(int newDefence)
Set the Defence value. |
void |
setExpertProduction(GoodsType newExpertProduction)
Set the ExpertProduction value. |
void |
setFoodConsumed(int newFoodConsumed)
Set the FoodConsumed value. |
void |
setHitPoints(int newHitPoints)
Set the HitPoints value. |
void |
setLineOfSight(int newLineOfSight)
Set the LineOfSight value. |
void |
setMaximumAttrition(int newMaximumAttrition)
Set the MaximumAttrition value. |
void |
setMovement(int newMovement)
Set the Movement value. |
void |
setOffence(int newOffence)
Set the Offence value. |
void |
setPathImage(java.lang.String newPathImage)
Set the PathImage value. |
void |
setPrice(int newPrice)
Set the Price value. |
void |
setRecruitProbability(int newRecruitProbability)
Set the RecruitProbability value. |
void |
setScoreValue(int newScoreValue)
Set the ScoreValue value. |
void |
setSkill(int newSkill)
Set the Skill value. |
void |
setSkillTaught(java.lang.String newSkillTaught)
Set the SkillTaught value. |
void |
setSpace(int newSpace)
Set the Space value. |
void |
setSpaceTaken(int newSpaceTaken)
Set the SpaceTaken value. |
| Methods inherited from class net.sf.freecol.common.model.BuildableType |
|---|
getAbilitiesRequired, getAmountRequiredOf, getGoodsRequired, getGoodsRequiredAsString, getPopulationRequired, readChild, setGoodsRequired, setPopulationRequired |
| Methods inherited from class net.sf.freecol.common.model.FreeColGameObjectType |
|---|
addAbility, addModifier, getFeatureContainer, getIndex, getModifierSet, hasAbility, hasAbility, readFromXML, readFromXMLImpl, setFeatureContainer, setIndex, toString, toXMLImpl |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_OFFENCE
public static final int DEFAULT_DEFENCE
public static final int FOOD_CONSUMPTION
private int offence
private int defence
private int space
private int hitPoints
private int spaceTaken
private int skill
private int price
private int movement
private int lineOfSight
private int recruitProbability
private GoodsType expertProduction
private int scoreValue
private java.lang.String pathImage
private int maximumAttrition
private java.lang.String skillTaught
private EquipmentType defaultEquipment
private int foodConsumed
private java.util.List<UnitTypeChange> typeChanges
| Constructor Detail |
|---|
public UnitType()
public UnitType(int index)
UnitType instance.
index - an int value| Method Detail |
|---|
public boolean canCarryUnits()
true if Units of this type can carry other Units.
boolean valuepublic boolean canCarryGoods()
true if Units of this type can carry Goods.
boolean valuepublic int getScoreValue()
ScoreValue value.
int valuepublic void setScoreValue(int newScoreValue)
ScoreValue value.
newScoreValue - The new ScoreValue value.public int getOffence()
Offence value.
int valuepublic void setOffence(int newOffence)
Offence value.
newOffence - The new Offence value.public int getDefence()
Defence value.
int valuepublic void setDefence(int newDefence)
Defence value.
newDefence - The new Defence value.public int getLineOfSight()
LineOfSight value.
int valuepublic void setLineOfSight(int newLineOfSight)
LineOfSight value.
newLineOfSight - The new Defence value.public int getSpace()
Space value.
int valuepublic void setSpace(int newSpace)
Space value.
newSpace - The new Space value.public int getHitPoints()
HitPoints value.
int valuepublic void setHitPoints(int newHitPoints)
HitPoints value.
newHitPoints - The new HitPoints value.public int getSpaceTaken()
SpaceTaken value.
int valuepublic void setSpaceTaken(int newSpaceTaken)
SpaceTaken value.
newSpaceTaken - The new SpaceTaken value.public boolean isRecruitable()
boolean valuepublic int getRecruitProbability()
RecruitProbability value.
int valuepublic void setRecruitProbability(int newRecruitProbability)
RecruitProbability value.
newRecruitProbability - The new RecruitProbability value.public int getSkill()
Skill value.
int valuepublic void setSkill(int newSkill)
Skill value.
newSkill - The new Skill value.public int getPrice()
Price value.
int value
This returns the base price of the UnitType
For the actual price of the unit, use Europe.getUnitPrice(UnitType)public void setPrice(int newPrice)
Price value.
newPrice - The new Price value.public int getMovement()
Movement value.
int valuepublic void setMovement(int newMovement)
Movement value.
newMovement - The new Movement value.public int getMaximumAttrition()
MaximumAttrition value.
int valuepublic void setMaximumAttrition(int newMaximumAttrition)
MaximumAttrition value.
newMaximumAttrition - The new MaximumAttrition value.public GoodsType getExpertProduction()
ExpertProduction value.
GoodsType valuepublic void setExpertProduction(GoodsType newExpertProduction)
ExpertProduction value.
newExpertProduction - The new ExpertProduction value.public EquipmentType getDefaultEquipmentType()
DefaultEquipment value.
EquipmentType valuepublic void setDefaultEquipmentType(EquipmentType newDefaultEquipment)
DefaultEquipment value.
newDefaultEquipment - The new DefaultEquipment value.public EquipmentType[] getDefaultEquipment()
public java.util.List<UnitTypeChange> getTypeChanges()
public java.lang.String getPathImage()
PathImage value.
String valuepublic void setPathImage(java.lang.String newPathImage)
PathImage value.
newPathImage - The new PathImage value.public java.lang.String getSkillTaught()
SkillTaught value.
String valuepublic void setSkillTaught(java.lang.String newSkillTaught)
SkillTaught value.
newSkillTaught - The new SkillTaught value.public int getFoodConsumed()
int valuepublic void setFoodConsumed(int newFoodConsumed)
FoodConsumed value.
newFoodConsumed - The new FoodConsumed value.public boolean isAvailableTo(Player player)
player - a Player value
boolean value
public UnitType getUnitTypeChange(UnitTypeChange.ChangeType changeType,
Player player)
getUnitTypeChange method here.
changeType - an UnitTypeChange.Type valueplayer - a Player value
UnitType value
public boolean canBeUpgraded(UnitType newType,
UnitTypeChange.ChangeType changeType)
newType - the UnitType to learnchangeType - an ChangeType value
true if can learn the given UnitTypepublic java.util.List<UnitType> getUnitTypesLearntInLostCity()
UnitType with a skill equal or less than given
maximumpublic UnitType getEducationUnit(int maximumSkill)
maximumSkill - the maximum level skill which we are searching for
UnitType with a skill equal or less than given
maximumpublic int getEducationTurns(UnitType unitType)
EducationTurns value.
int value
public void readAttributes(javax.xml.stream.XMLStreamReader in,
Specification specification)
throws javax.xml.stream.XMLStreamException
readAttributes in class BuildableTypejavax.xml.stream.XMLStreamException
public void readChildren(javax.xml.stream.XMLStreamReader in,
Specification specification)
throws javax.xml.stream.XMLStreamException
readChildren in class FreeColGameObjectTypejavax.xml.stream.XMLStreamExceptionpublic boolean hasSkill()
boolean valuepublic boolean canBeBuilt()
boolean valuepublic boolean hasPrice()
boolean value
public int getProductionFor(GoodsType goodsType,
int base)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||