Package net.sf.freecol.server.ai
Class WorkLocationPlan
- java.lang.Object
-
- net.sf.freecol.common.model.FreeColObject
-
- net.sf.freecol.server.ai.AIObject
-
- net.sf.freecol.server.ai.WorkLocationPlan
-
- All Implemented Interfaces:
java.lang.Comparable<FreeColObject>
,ObjectWithId
public final class WorkLocationPlan extends AIObject
Objects of this class contains AI-information for a singleWorkLocation
.
-
-
Field Summary
Fields Modifier and Type Field Description private GoodsType
goodsType
The goods to produce.private static java.util.logging.Logger
logger
static java.lang.String
TAG
private WorkLocation
workLocation
The work location the plan is for.-
Fields inherited from class net.sf.freecol.server.ai.AIObject
initialized
-
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ARRAY_SIZE_TAG, DEFAULT_CLASS_INDEX, fcoComparator, ID_ATTRIBUTE_TAG, PARTIAL_ATTRIBUTE_TAG, VALUE_TAG
-
-
Constructor Summary
Constructors Constructor Description WorkLocationPlan(AIMain aiMain, WorkLocation workLocation, GoodsType goodsType)
Creates a newWorkLocationPlan
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GoodsType
getGoodsType()
Gets the type of goods which should be produced at theWorkLocation
.WorkLocation
getWorkLocation()
Gets theWorkLocation
thisWorkLocationPlan
controls.java.lang.String
getXMLTagName()
Get the serialization tag for this object.boolean
isFoodPlan()
Is this a food producing plan?void
setGoodsType(GoodsType goodsType)
Sets the type of goods to be produced at theWorkLocation
.void
setInitialized()
Set the initialized flag in this object.java.lang.String
toString()
-
Methods inherited from class net.sf.freecol.server.ai.AIObject
addAIObjectWithId, checkIntegrity, checkIntegrity, copyIn, dispose, getAIMain, getGame, getSpecification, isDisposed, setGame, setSpecification
-
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addAbility, addFeatures, addModifier, addPropertyChangeListener, addPropertyChangeListener, apply, apply, applyModifiers, applyModifiers, arrayKey, compareIds, compareTo, containsAbilityKey, containsModifierKey, copy, copy, copy, copy, copyInCast, dumpObject, equals, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAbilities, getAbilities, getAbilities, getAbilities, getClassIndex, getDefenceModifiers, getDisplayObject, getFeatureContainer, getFreeColObjectClass, getFreeColObjectClassByName, getId, getIdNumber, getIdType, getIdTypeByName, getModifiers, getModifiers, getModifiers, getModifiers, getObjectClassIndex, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getSortedAbilities, getSortedModifiers, getSuffix, getSuffix, hasAbility, hasAbility, hasAbility, hashCode, hasListeners, hasModifier, hasModifier, hasModifier, idEquals, invokeMethod, logFreeColObjects, readAttributes, readChild, readChildren, readFromXML, readFromXMLPartial, removeAbilities, removeAbility, removeFeatures, removeModifier, removeModifiers, removePropertyChangeListener, removePropertyChangeListener, save, save, save, save, serialize, serialize, serialize, serialize, setId, toXML, toXML, toXMLPartial, toXMLPartial, writeAttributes, writeChildren
-
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
TAG
public static final java.lang.String TAG
- See Also:
- Constant Field Values
-
workLocation
private WorkLocation workLocation
The work location the plan is for.
-
goodsType
private GoodsType goodsType
The goods to produce.
-
-
Constructor Detail
-
WorkLocationPlan
public WorkLocationPlan(AIMain aiMain, WorkLocation workLocation, GoodsType goodsType)
Creates a newWorkLocationPlan
.- Parameters:
aiMain
- The main AI-object.workLocation
- TheWorkLocation
to create a plan for.goodsType
- The goodsType to be produced on theworkLocation
using this plan.
-
-
Method Detail
-
setInitialized
public void setInitialized()
Set the initialized flag in this object. To be implemented by leaf classes, and called in their constructors plus the special case in readChild below where we resolve forward references.- Specified by:
setInitialized
in classAIObject
-
getWorkLocation
public WorkLocation getWorkLocation()
Gets theWorkLocation
thisWorkLocationPlan
controls.- Returns:
- The
WorkLocation
.
-
getGoodsType
public GoodsType getGoodsType()
Gets the type of goods which should be produced at theWorkLocation
.- Returns:
- The type of goods.
- See Also:
Goods
,WorkLocation
-
setGoodsType
public void setGoodsType(GoodsType goodsType)
Sets the type of goods to be produced at theWorkLocation
.- Parameters:
goodsType
- The type of goods.- See Also:
Goods
,WorkLocation
-
isFoodPlan
public boolean isFoodPlan()
Is this a food producing plan?- Returns:
- True if this plan produces food.
-
getXMLTagName
public java.lang.String getXMLTagName()
Get the serialization tag for this object.- Specified by:
getXMLTagName
in classFreeColObject
- Returns:
- The tag.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classFreeColObject
-
-