net.sf.freecol.server.ai.goal
Class ManageMissionariesGoal

java.lang.Object
  extended by net.sf.freecol.common.model.FreeColObject
      extended by net.sf.freecol.server.ai.AIObject
          extended by net.sf.freecol.server.ai.goal.Goal
              extended by net.sf.freecol.server.ai.goal.ManageMissionariesGoal
All Implemented Interfaces:
GoalConstants

public class ManageMissionariesGoal
extends Goal

This Goal deals with all missionaries of one AIPlayer.

For each missionary unit that is being added, this goal will try to find an IndianSettlement needing a visit. Distance and reachability from the current position of the unit are taken into account, with the implicit assumption that the current location of the unit is sensible in that a nearby settlement is even worth visiting. Since missionary units are either created in a player-owned colony, or brought there from Europe, this assumption will most often be valid.

If a settlement has been found, a CreateMissionAtSettlementGoal will be created, and the unit be moved there.


Field Summary
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ID_ATTRIBUTE_TAG
 
Fields inherited from interface net.sf.freecol.server.ai.goal.GoalConstants
MAX_SEARCH_RADIUS
 
Constructor Summary
ManageMissionariesGoal(AIPlayer p, Goal g, float w)
           
 
Method Summary
 java.lang.String getGoalDescription()
          Returns a string describing just this goal.
 
Methods inherited from class net.sf.freecol.server.ai.goal.Goal
addUnit, cancelGoal, canYieldUnit, doPlanning, getAbsoluteWeight, getDebugDescription, getParentWeight, getWeight, getXMLElementTagName, getYieldedUnitWeight, isFinished, needsPlanning, normalizeSubGoalWeights, setNeedsPlanningRecursive, setWeight, yieldUnit
 
Methods inherited from class net.sf.freecol.server.ai.AIObject
dispose, getAIMain, getGame, isUninitialized, readFromXML
 
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAttribute, getAttribute, getAttribute, getAttribute, getId, getPropertyChangeListeners, getPropertyChangeListeners, hasAbility, hasAttribute, hasListeners, readFromXMLElement, removePropertyChangeListener, removePropertyChangeListener, toXML, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, writeAttribute, writeFreeColGameObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManageMissionariesGoal

public ManageMissionariesGoal(AIPlayer p,
                              Goal g,
                              float w)
Method Detail

getGoalDescription

public java.lang.String getGoalDescription()
Description copied from class: Goal
Returns a string describing just this goal. An implementing class may override this method to add specialized information. Used by getDebugDescription.

Overrides:
getGoalDescription in class Goal
Returns:
a string describing this goal