|
|||||||||
| 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.GoodsType
public final class GoodsType
| Field Summary | |
|---|---|
private int |
breedingNumber
The number of units required to breed this type of goods. |
private boolean |
buildingMaterial
Whether this type of goods is required for building. |
private boolean |
ignoreLimit
|
private int |
initialAmount
|
private int |
initialPrice
|
private boolean |
isFarmed
|
private boolean |
isFood
|
private GoodsType |
madeFrom
|
private GoodsType |
makes
|
private boolean |
militaryGoods
Whether this type of goods is required for building equipment that grants an offence bonus or defence bonus. |
private boolean |
newWorldGoods
|
private int |
price
The price of this type of goods. |
private int |
priceDiff
|
private boolean |
storable
Whether this type of goods can be stored in a warehouse. |
private GoodsType |
storedAs
|
private boolean |
tradeGoods
Whether these are trade goods that can only be obtained in Europe. |
| 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 | |
|---|---|
GoodsType(java.lang.String id,
Specification specification)
|
|
| Method Summary | |
|---|---|
int |
getBreedingNumber()
Get the BreedingNumber value. |
int |
getInitialAmount()
|
int |
getInitialBuyPrice()
|
int |
getInitialSellPrice()
|
StringTemplate |
getLabel(boolean sellable)
|
int |
getPrice()
Get the Price value. |
int |
getPriceDifference()
|
GoodsType |
getProducedMaterial()
|
java.util.List<GoodsType> |
getProductionChain()
Returns the production chain of the goods type, beginning with a raw material that can not be produced from any other. |
GoodsType |
getRawMaterial()
|
GoodsType |
getStoredAs()
|
java.lang.String |
getWorkingAsKey()
|
static java.lang.String |
getXMLElementTagName()
Returns the tag name of the root element representing this object. |
GoodsType |
inputType()
|
boolean |
isBreedable()
Returns true if this type of Goods is
breedable. |
boolean |
isBuildingMaterial()
Returns true if this type of goods is required for building a BuildableType. |
boolean |
isFarmed()
|
boolean |
isFoodType()
|
boolean |
isImmigrationGoodsType()
Whether this type of goods causes immigration. |
boolean |
isImmigrationType()
Get the ImmigrationType value. |
boolean |
isLibertyGoodsType()
Whether this type of goods produces liberty points. |
boolean |
isLibertyType()
Get the LibertyType value. |
boolean |
isMilitaryGoods()
Get the MilitaryGoods value. |
boolean |
isNewWorldGoodsType()
|
boolean |
isNewWorldLuxuryType()
|
boolean |
isRawBuildingMaterial()
Returns true if this type of goods is required for producing a type of goods required for building a BuildableType. |
boolean |
isRawMaterial()
|
boolean |
isRefined()
|
boolean |
isStorable()
|
boolean |
isStoredAs()
|
boolean |
isTradeGoods()
Get the TradeGoods value. |
boolean |
limitIgnored()
|
GoodsType |
outputType()
|
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 |
setBreedingNumber(int newBreedingNumber)
Set the BreedingNumber value. |
void |
setBuildingMaterial(boolean newBuildingMaterial)
Set the BuildingMaterial value. |
void |
setMilitaryGoods(boolean newMilitaryGoods)
Set the MilitaryGoods value. |
void |
setPrice(int newPrice)
Set the Price 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.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 isFarmed
private boolean isFood
private boolean ignoreLimit
private boolean newWorldGoods
private boolean buildingMaterial
private boolean militaryGoods
private boolean tradeGoods
private boolean storable
private GoodsType madeFrom
private GoodsType makes
private GoodsType storedAs
private int initialAmount
private int initialPrice
private int priceDiff
private int breedingNumber
private int price
| Constructor Detail |
|---|
public GoodsType(java.lang.String id,
Specification specification)
| Method Detail |
|---|
public StringTemplate getLabel(boolean sellable)
public boolean isRawMaterial()
public boolean isRefined()
public GoodsType getRawMaterial()
public GoodsType getProducedMaterial()
public boolean isFarmed()
public boolean limitIgnored()
public boolean isNewWorldGoodsType()
public boolean isNewWorldLuxuryType()
public final java.lang.String getWorkingAsKey()
public boolean isImmigrationType()
ImmigrationType value.
boolean valuepublic boolean isLibertyType()
LibertyType value.
boolean valuepublic boolean isStorable()
public boolean isStoredAs()
public GoodsType getStoredAs()
public int getInitialAmount()
public int getInitialSellPrice()
public int getInitialBuyPrice()
public int getPriceDifference()
public boolean isFoodType()
public GoodsType outputType()
public GoodsType inputType()
public boolean isBuildingMaterial()
boolean valueBuildableTypepublic void setBuildingMaterial(boolean newBuildingMaterial)
BuildingMaterial value.
newBuildingMaterial - The new BuildingMaterial value.public java.util.List<GoodsType> getProductionChain()
public boolean isRawBuildingMaterial()
boolean valueBuildableTypepublic boolean isMilitaryGoods()
MilitaryGoods value.
boolean valuepublic void setMilitaryGoods(boolean newMilitaryGoods)
MilitaryGoods value.
newMilitaryGoods - The new MilitaryGoods value.public boolean isTradeGoods()
TradeGoods value.
boolean valuepublic boolean isLibertyGoodsType()
boolean valuepublic boolean isImmigrationGoodsType()
boolean valuepublic int getBreedingNumber()
BreedingNumber value.
int valuepublic void setBreedingNumber(int newBreedingNumber)
BreedingNumber value.
newBreedingNumber - The new BreedingNumber value.public boolean isBreedable()
true if this type of Goods is
breedable. This should only be true for animals, such as
horses.
boolean valuepublic int getPrice()
Price value.
int valuepublic void setPrice(int newPrice)
Price value.
newPrice - The new Price 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 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 | ||||||||