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 GoodsTypegoodsTypeThe goods to produce.private static java.util.logging.Loggerloggerstatic java.lang.StringTAGprivate WorkLocationworkLocationThe 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 GoodsTypegetGoodsType()Gets the type of goods which should be produced at theWorkLocation.WorkLocationgetWorkLocation()Gets theWorkLocationthisWorkLocationPlancontrols.java.lang.StringgetXMLTagName()Get the serialization tag for this object.booleanisFoodPlan()Is this a food producing plan?voidsetGoodsType(GoodsType goodsType)Sets the type of goods to be produced at theWorkLocation.voidsetInitialized()Set the initialized flag in this object.java.lang.StringtoString()-
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- TheWorkLocationto create a plan for.goodsType- The goodsType to be produced on theworkLocationusing 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:
setInitializedin classAIObject
-
getWorkLocation
public WorkLocation getWorkLocation()
Gets theWorkLocationthisWorkLocationPlancontrols.- 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:
getXMLTagNamein classFreeColObject- Returns:
- The tag.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classFreeColObject
-
-