|
|||||||||
| 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.goal.Goal
net.sf.freecol.server.ai.goal.CreateMissionAtSettlementGoal
public class CreateMissionAtSettlementGoal
This Goal deals with one missionary unit.
On construction, an AIUnit and an IndianSettlement
are given to this.
The Goal will try to create a mission at that settlement,
eventually by bringing the missionary unit there first using a GotoAdjacentGoal.
Should the target become invalid, the missionary will be given back
to the parent of this goal (ManageMissionariesGoal, in most cases).
Excess units will be given back to the parent, or the AIPlayer directly.
| Field Summary | |
|---|---|
private GotoAdjacentGoal |
gotoSubGoal
|
private static java.util.logging.Logger |
logger
|
private IndianSettlement |
target
|
| Fields inherited from class net.sf.freecol.server.ai.goal.Goal |
|---|
availableUnitsList, isFinished, needsPlanning, player |
| 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, PARTIAL_ATTRIBUTE |
| Fields inherited from interface net.sf.freecol.server.ai.goal.GoalConstants |
|---|
MAX_SEARCH_RADIUS |
| Constructor Summary | |
|---|---|
CreateMissionAtSettlementGoal(AIPlayer p,
Goal g,
float w,
AIUnit u,
IndianSettlement i)
|
|
| Method Summary | |
|---|---|
java.lang.String |
getGoalDescription()
Returns a string describing just this goal. |
protected java.util.Iterator<AIUnit> |
getOwnedAIUnitsIterator()
Since internal implementation details may vary, each Goal will define an iterator over all of its units. |
protected java.util.Iterator<Goal> |
getSubGoalIterator()
Since internal implementation details may vary, each Goal will define an iterator over all of its subgoals. |
protected void |
plan()
Plans this goal. |
protected void |
readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
Reads information for this object from an XML stream. |
protected void |
removeUnit(AIUnit u)
Ensures that a unit moved to another Goal is properly removed from this. |
protected void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out)
Writes this object to an XML stream. |
| Methods inherited from class net.sf.freecol.server.ai.goal.Goal |
|---|
addUnit, addUnitToParent, cancelGoal, canYieldUnit, doPlanning, getAbsoluteWeight, getDebugDescription, getParentWeight, getWeight, getXMLElementTagName, getYieldedUnitWeight, isFinished, needsPlanning, normalizeSubGoalWeights, requestWorker, setNeedsPlanningRecursive, setWeight, validateOwnedUnits, yieldUnit |
| Methods inherited from class net.sf.freecol.server.ai.AIObject |
|---|
dispose, getAIMain, getAIRandom, getGame, 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 IndianSettlement target
private GotoAdjacentGoal gotoSubGoal
| Constructor Detail |
|---|
public CreateMissionAtSettlementGoal(AIPlayer p,
Goal g,
float w,
AIUnit u,
IndianSettlement i)
| Method Detail |
|---|
protected java.util.Iterator<AIUnit> getOwnedAIUnitsIterator()
Goal
getOwnedAIUnitsIterator in class GoalAIUnit currently managed by this goal.protected java.util.Iterator<Goal> getSubGoalIterator()
Goal
getSubGoalIterator in class Goalprotected void removeUnit(AIUnit u)
GoalGoal.yieldUnit(UnitType,AIObject),
or if the Unit contained in the AIUnit no longer is valid,
this method is called to clean up any remaining references to the unit.
Any implementation of this will need to iterate over all AIUnit object references used by this goal, and remove those that equal the given parameter.
removeUnit in class Goalu - The AIUnit supposed to be removed from this goal.protected void plan()
plan in class Goalpublic java.lang.String getGoalDescription()
GoalgetDebugDescription.
getGoalDescription in class Goal
protected void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
Goal
toXMLImpl in class Goalout - The target stream.
javax.xml.stream.XMLStreamException - if there are any problems writing to the
stream.
protected void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
Goal
readFromXMLImpl in class Goalin - The input stream with the XML.
javax.xml.stream.XMLStreamException - if there are any problems reading from the
stream.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||