|
||||||||||
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.server.ai.AIObject
net.sf.freecol.server.ai.ValuedAIObject
net.sf.freecol.server.ai.WorkLocationPlan
public class WorkLocationPlan
Objects of this class contains AI-information for a single WorkLocation
.
Field Summary |
---|
Fields inherited from class net.sf.freecol.common.model.FreeColObject |
---|
ID_ATTRIBUTE_TAG |
Constructor Summary | |
---|---|
WorkLocationPlan(AIMain aiMain,
org.w3c.dom.Element element)
Creates a new WorkLocationPlan . |
|
WorkLocationPlan(AIMain aiMain,
WorkLocation workLocation,
GoodsType goodsType)
Creates a new WorkLocationPlan . |
Method Summary | |
---|---|
TileImprovementPlan |
createTileImprovementPlan()
Gets a TileImprovementPlan which will improve
the production of the goods type specified by this
WorkLocationPlan . |
GoodsType |
getGoodsType()
Gets the type of goods which should be produced at the WorkLocation . |
int |
getProductionOf(GoodsType goodsType)
Gets the production of the given type of goods according to this WorkLocationPlan . |
WorkLocation |
getWorkLocation()
Gets the WorkLocation this
WorkLocationPlan controls. |
static java.lang.String |
getXMLElementTagName()
Returns the tag name of the root element representing this object. |
void |
readFromXMLElement(org.w3c.dom.Element element)
Updates this object from an XML-representation of a WorkLocationPlan . |
void |
setGoodsType(GoodsType goodsType)
Sets the type of goods to be produced at the WorkLocation . |
org.w3c.dom.Element |
toXMLElement(org.w3c.dom.Document document)
Creates an XML-representation of this object. |
TileImprovementPlan |
updateTileImprovementPlan(TileImprovementPlan tip)
Updates the given TileImprovementPlan . |
Methods inherited from class net.sf.freecol.server.ai.ValuedAIObject |
---|
compareTo, getValue, setValue |
Methods inherited from class net.sf.freecol.server.ai.AIObject |
---|
dispose, getAIMain, getGame, isUninitialized, readFromXML |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WorkLocationPlan(AIMain aiMain, WorkLocation workLocation, GoodsType goodsType)
WorkLocationPlan
.
aiMain
- The main AI-object.workLocation
- The WorkLocation
to create
a plan for.goodsType
- The goodsType to be produced on the
workLocation
using this plan.public WorkLocationPlan(AIMain aiMain, org.w3c.dom.Element element)
WorkLocationPlan
.
aiMain
- The main AI-object.element
- An Element
containing an
XML-representation of this object.Method Detail |
---|
public TileImprovementPlan createTileImprovementPlan()
TileImprovementPlan
which will improve
the production of the goods type specified by this
WorkLocationPlan
.
TileImprovementPlan
if there is an
improvement, plow or build road, which will increase
the production of the goods type specified by this
plan. null
gets returned if this plan is
for a Building
or that the Tile
does not have an improvement.public TileImprovementPlan updateTileImprovementPlan(TileImprovementPlan tip)
TileImprovementPlan
.
tip
- The TileImprovementPlan
to update.
TileImprovementPlan
-object
as provided to the method or null
if
there is no more need for the improvement.public WorkLocation getWorkLocation()
WorkLocation
this
WorkLocationPlan
controls.
WorkLocation
.public int getProductionOf(GoodsType goodsType)
WorkLocationPlan
. The plan has been created for either
a ColonyTile
or a Building
. If this is a plan for a
ColonyTile
then the maximum possible production of the
tile gets returned, while the Building
-plans only returns
a number used for identifying the value of the goods produced.
goodsType
- The type of goods to get the production for.
public GoodsType getGoodsType()
WorkLocation
.
Goods
,
WorkLocation
public void setGoodsType(GoodsType goodsType)
WorkLocation
.
goodsType
- The type of goods.Goods
,
WorkLocation
public org.w3c.dom.Element toXMLElement(org.w3c.dom.Document document)
toXMLElement
in class FreeColObject
document
- The Document
in which
the XML-representation should be created.
public void readFromXMLElement(org.w3c.dom.Element element)
WorkLocationPlan
.
readFromXMLElement
in class FreeColObject
element
- The XML-representation.public static java.lang.String getXMLElementTagName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |