|
|||||||||
| 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.SettlementType
public class SettlementType
| Field Summary | |
|---|---|
private boolean |
capital
Whether this SettlementType is a capital. |
private int |
claimableRadius
How many tiles this SettlementType can claim. |
private int |
extraClaimableRadius
The extra radius beyond the claimableRadius where wandering units may claim as yet unclaimed tiles. |
private java.util.List<RandomRange> |
gifts
The gifts this SettlementType generates when visited by a scout. |
private int |
maximumGrowth
The maximum number of tiles to grown this SettlementType. |
private int |
maximumSize
The maximum number of units for this SettlementType. |
private int |
minimumGrowth
The minimum number of tiles to grow this SettlementType. |
private int |
minimumSize
The minimum number of units for this SettlementType. |
private java.util.List<RandomRange> |
plunder
The plunder this SettlementType generates when destroyed. |
private int |
tradeBonus
The general trade bonus, roughly proportional to the settlement size and general sophistication. |
private int |
visibleRadius
How many tiles this SettlementType can see. |
private int |
wanderingRadius
How far units from this SettlementType may roam. |
| 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 | |
|---|---|
SettlementType(java.lang.String id,
Specification specification)
Creates a new SettlementType instance. |
|
| Method Summary | |
|---|---|
int |
getClaimableRadius()
Get the ClaimableRadius value. |
int |
getExtraClaimableRadius()
Get the extraClaimableRadius value. |
RandomRange |
getGifts(Unit unit)
Get the Gifts value. |
int |
getMaximumGrowth()
Get the maximum growth value. |
int |
getMaximumSize()
Get the MaximumSize value. |
int |
getMinimumGrowth()
Get the minimum growth value. |
int |
getMinimumSize()
Get the MinimumSize value. |
RandomRange |
getPlunderRange(Unit unit)
Gets the plunder range available for the supplied unit. |
int |
getTradeBonus()
Gets the trade bonus. |
int |
getVisibleRadius()
Get the VisibleRadius value. |
int |
getWanderingRadius()
Get the WanderingRadius value. |
int |
getWarehouseCapacity()
Gets the warehouse capacity of this settlement. |
static java.lang.String |
getXMLElementTagName()
Returns the tag name of the root element representing this object. |
boolean |
isCapital()
Get the Capital value. |
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. |
void |
setCapital(boolean newCapital)
Set the Capital value. |
void |
setClaimableRadius(int newClaimableRadius)
Set the ClaimableRadius value. |
void |
setGifts(RandomRange newGifts)
Set the Gifts value. |
void |
setMaximumSize(int newMaximumSize)
Set the MaximumSize value. |
void |
setMinimumSize(int newMinimumSize)
Set the MinimumSize value. |
void |
setPlunder(RandomRange newPlunder)
Set the Plunder value. |
void |
setVisibleRadius(int newVisibleRadius)
Set the VisibleRadius value. |
void |
setWanderingRadius(int newWanderingRadius)
Set the WanderingRadius value. |
protected void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out)
This method writes an XML-representation of this object to the given stream. |
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.FreeColGameObjectType |
|---|
addAbility, addModifier, applyDifficultyLevel, getDescriptionKey, getFeatureContainer, getIndex, getModifierIndex, getModifierIndex, getModifierSet, getNameKey, hasAbility, hasAbility, isAbstractType, readChildren, setAbstractType, setFeatureContainer, setIndex, setModifierIndex, toString, toXMLImpl |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private boolean capital
private int visibleRadius
private int claimableRadius
private int extraClaimableRadius
private int wanderingRadius
private java.util.List<RandomRange> plunder
private java.util.List<RandomRange> gifts
private int minimumSize
private int maximumSize
private int minimumGrowth
private int maximumGrowth
private int tradeBonus
| Constructor Detail |
|---|
public SettlementType(java.lang.String id,
Specification specification)
SettlementType instance.
id - a String valuespecification - a Specification value| Method Detail |
|---|
public final boolean isCapital()
Capital value.
boolean valuepublic final void setCapital(boolean newCapital)
Capital value.
newCapital - The new Capital value.public final int getMinimumSize()
MinimumSize value.
int valuepublic final void setMinimumSize(int newMinimumSize)
MinimumSize value.
newMinimumSize - The new MinimumSize value.public final int getMaximumSize()
MaximumSize value.
int valuepublic final void setMaximumSize(int newMaximumSize)
MaximumSize value.
newMaximumSize - The new MaximumSize value.public final int getVisibleRadius()
VisibleRadius value.
int valuepublic final void setVisibleRadius(int newVisibleRadius)
VisibleRadius value.
newVisibleRadius - The new VisibleRadius value.public final int getClaimableRadius()
ClaimableRadius value.
int valuepublic final int getExtraClaimableRadius()
extraClaimableRadius value.
public final void setClaimableRadius(int newClaimableRadius)
ClaimableRadius value.
newClaimableRadius - The new ClaimableRadius value.public final int getWanderingRadius()
WanderingRadius value.
int valuepublic final void setWanderingRadius(int newWanderingRadius)
WanderingRadius value.
newWanderingRadius - The new WanderingRadius value.public final int getMinimumGrowth()
public final int getMaximumGrowth()
public final int getTradeBonus()
public final RandomRange getPlunderRange(Unit unit)
unit - The Unit to check.
public final void setPlunder(RandomRange newPlunder)
Plunder value.
newPlunder - The new Plunder value.public final RandomRange getGifts(Unit unit)
Gifts value.
unit - an Unit value
RandomRange valuepublic final void setGifts(RandomRange newGifts)
Gifts value.
newGifts - The new Gifts value.public int getWarehouseCapacity()
protected void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
toXMLImpl in class FreeColGameObjectTypeout - The target 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 FreeColObjectout - 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 FreeColGameObjectTypeout - 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 readChild(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
readChild in class FreeColGameObjectTypein - 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 | ||||||||