|
|||||||||
| 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 | |
|---|---|
private GoodsType |
goodsType
|
private static java.util.logging.Logger |
logger
|
private int |
priority
|
private WorkLocation |
workLocation
The FreeColGameObject this AIObject contains AI-information for. |
| Fields inherited from class net.sf.freecol.server.ai.AIObject |
|---|
uninitialized |
| Fields inherited from class net.sf.freecol.common.model.FreeColObject |
|---|
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, INFINITY, NO_ID, PARTIAL_ATTRIBUTE, UNDEFINED, VALUE_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 | |
|---|---|
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. |
protected void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out)
This method writes an XML-representation of this object to the given stream. |
| 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, getSpecification, isUninitialized, readFromXML |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.util.logging.Logger logger
private WorkLocation workLocation
private int priority
private GoodsType goodsType
| 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 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,
WorkLocationpublic void setGoodsType(GoodsType goodsType)
WorkLocation.
goodsType - The type of goods.Goods,
WorkLocation
protected void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
FreeColObject
toXMLImpl in class FreeColObjectout - The target stream.
javax.xml.stream.XMLStreamException - if there are any problems writing
to the stream.public org.w3c.dom.Element toXMLElement(org.w3c.dom.Document document)
toXMLElement in class FreeColObjectdocument - The Document in which
the XML-representation should be created.
public void readFromXMLElement(org.w3c.dom.Element element)
WorkLocationPlan.
readFromXMLElement in class FreeColObjectelement - 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 | ||||||||