net.sf.freecol.server.ai
Class EuropeanAIPlayer

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.NewAIPlayer
              extended by net.sf.freecol.server.ai.EuropeanAIPlayer
Direct Known Subclasses:
REFAIPlayer

Deprecated. Currently unused, outdated copy of AIPlayer. Eventual specialization of AI should extend AIPlayer, see ColonialAIPlayer. The method NewAIPlayer.startWorking() gets called by the AIInGameInputHandler when it is this player's turn.

public abstract class EuropeanAIPlayer
extends NewAIPlayer

Objects of this class contains AI-information for a single Player and is used for controlling this player.


Field Summary
private static java.util.logging.Logger logger
          Deprecated.  
 
Fields inherited from class net.sf.freecol.server.ai.NewAIPlayer
horses, muskets, sessionRegister, toolsType
 
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
 
Constructor Summary
EuropeanAIPlayer()
          Deprecated.  
 
Method Summary
abstract  boolean acceptIndianDemand(Unit unit, Colony colony, Goods goods, int gold)
          Deprecated. Decides whether to accept an Indian demand, or not.
protected  void createAIGoodsInColonies()
          Deprecated. Calls AIColony.createAIGoods() for every colony this player owns.
protected  void createTransportLists()
          Deprecated. Maps Transportables to carrier's using a TransportMission.
protected  void ensureCorrectMissions()
          Deprecated. Ensures that all workers inside a colony gets a WorkInsideColonyMission.
 java.util.Iterator<AIColony> getAIColonyIterator()
          Deprecated. Returns an iterator over all the AIColonys owned by this getPlayer().
(package private)  int getDefendColonyMissionValue(Unit u, Colony colony, int turns)
          Deprecated.  
 java.util.Iterator<TileImprovementPlan> getTileImprovementPlanIterator()
          Deprecated. Returns an Iterator over all the TileImprovements needed by all of this player's colonies.
 java.util.Iterator<Wish> getWishIterator()
          Deprecated. Returns an Iterator for all the wishes.
(package private)  void giveMilitaryMission(AIUnit aiUnit)
          Deprecated. Gives a military Mission to the given unit.
protected  void giveNavalMissions()
          Deprecated. Gives missions to all the naval units this player owns.
 boolean hasFewColonies()
          Deprecated. This is a temporary method which are used for forcing the computer players into building more colonies.
 boolean hasManOfWar()
          Deprecated. Checks if this player has a single Man-of-War.
protected  void rearrangeWorkersInColonies()
          Deprecated. Calls AIColony.rearrangeWorkers(net.sf.freecol.common.networking.Connection) for every colony this player owns.
 AIUnit recruitAIUnitInEurope(int slot)
          Deprecated. Ask the server to recruit a unit in Europe on behalf of the AIPlayer
protected  void secureColony(Colony colony)
          Deprecated. Takes the necessary actions to secure a european colony
protected  void secureSettlements()
          Deprecated. Takes the necessary actions to secure the settlements.
 int tradeProposition(Unit unit, Settlement settlement, Goods goods, int gold)
          Deprecated. Called when another Player proposes a trade.
 AIUnit trainAIUnitInEurope(UnitType unitType)
          Deprecated. Ask the server to train a unit in Europe on behalf of the AIPlayer
 
Methods inherited from class net.sf.freecol.server.ai.NewAIPlayer
abortInvalidAndOneTimeMissions, abortInvalidMissions, buyProposition, clearAIUnits, determineStances, doMissions, getAIUnitIterator, getBestTreasureTrain, getConnection, getId, getPlayer, getUnitSeekAndDestroyMissionValue, getXMLElementTagName, isTargetValidForSeekAndDestroy, readFromXMLImpl, registerSellGoods, sendAndWaitSafely, sendUpdatedTilesToAll, setDebuggingConnection, startWorking, toXMLImpl
 
Methods inherited from class net.sf.freecol.server.ai.AIObject
dispose, getAIMain, getAIRandom, 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, getPropertyChangeListeners, getPropertyChangeListeners, hasAbility, hasAttribute, hasListeners, readAttributes, readChildren, readFromArrayElement, readFromArrayElement, readFromArrayElement, readFromListElement, readFromXMLElement, readFromXMLPartialImpl, removePropertyChangeListener, removePropertyChangeListener, setId, toArrayElement, toArrayElement, toListElement, toXML, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, toXMLPartialImpl, writeAttribute, writeAttributes, writeChildren, writeFreeColGameObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final java.util.logging.Logger logger
Deprecated. 
Constructor Detail

EuropeanAIPlayer

public EuropeanAIPlayer()
Deprecated. 
Method Detail

hasManOfWar

public boolean hasManOfWar()
Deprecated. 
Checks if this player has a single Man-of-War.

Returns:
true if this player owns a single Man-of-War.

trainAIUnitInEurope

public AIUnit trainAIUnitInEurope(UnitType unitType)
Deprecated. 
Ask the server to train a unit in Europe on behalf of the AIPlayer


recruitAIUnitInEurope

public AIUnit recruitAIUnitInEurope(int slot)
Deprecated. 
Ask the server to recruit a unit in Europe on behalf of the AIPlayer


ensureCorrectMissions

protected void ensureCorrectMissions()
Deprecated. 
Ensures that all workers inside a colony gets a WorkInsideColonyMission.


giveNavalMissions

protected void giveNavalMissions()
Deprecated. 
Gives missions to all the naval units this player owns.


rearrangeWorkersInColonies

protected void rearrangeWorkersInColonies()
Deprecated. 
Calls AIColony.rearrangeWorkers(net.sf.freecol.common.networking.Connection) for every colony this player owns.


secureSettlements

protected void secureSettlements()
Deprecated. 
Takes the necessary actions to secure the settlements. This is done by making new military units or to give existing units new missions.


secureColony

protected void secureColony(Colony colony)
Deprecated. 
Takes the necessary actions to secure a european colony


createAIGoodsInColonies

protected void createAIGoodsInColonies()
Deprecated. 
Calls AIColony.createAIGoods() for every colony this player owns.


getDefendColonyMissionValue

int getDefendColonyMissionValue(Unit u,
                                Colony colony,
                                int turns)
Deprecated. 

giveMilitaryMission

void giveMilitaryMission(AIUnit aiUnit)
Deprecated. 
Gives a military Mission to the given unit.

This method should only be used on units owned by european players.

Parameters:
aiUnit - The unit.

getTileImprovementPlanIterator

public java.util.Iterator<TileImprovementPlan> getTileImprovementPlanIterator()
Deprecated. 
Returns an Iterator over all the TileImprovements needed by all of this player's colonies.

Returns:
The Iterator.
See Also:
TileImprovement

hasFewColonies

public boolean hasFewColonies()
Deprecated. 
This is a temporary method which are used for forcing the computer players into building more colonies. The method will be removed after the proper code for deciding whether a colony should be built or not has been implemented.

Returns:
true if the AI should build more colonies.

createTransportLists

protected void createTransportLists()
Deprecated. 
Maps Transportables to carrier's using a TransportMission.


tradeProposition

public int tradeProposition(Unit unit,
                            Settlement settlement,
                            Goods goods,
                            int gold)
Deprecated. 
Called when another Player proposes a trade.

Parameters:
unit - The foreign Unit trying to trade.
settlement - The Settlement this player owns and which the given Unit if trying to sell goods.
goods - The goods the given Unit is trying to sell.
gold - The suggested price.
Returns:
The price this AIPlayer suggests or NetworkConstants.NO_TRADE.

acceptIndianDemand

public abstract boolean acceptIndianDemand(Unit unit,
                                           Colony colony,
                                           Goods goods,
                                           int gold)
Deprecated. 
Decides whether to accept an Indian demand, or not.

Parameters:
unit - The unit making demands.
colony - The colony where demands are being made.
goods - The goods demanded.
gold - The amount of gold demanded.
Returns:
true if this AIPlayer accepts the indian demand and false otherwise.

getAIColonyIterator

public java.util.Iterator<AIColony> getAIColonyIterator()
Deprecated. 
Returns an iterator over all the AIColonys owned by this getPlayer().

Returns:
The Iterator.

getWishIterator

public java.util.Iterator<Wish> getWishIterator()
Deprecated. 
Returns an Iterator for all the wishes. The items are sorted by the value, with the item having the highest value appearing first in the Iterator.

Returns:
The Iterator.
See Also:
Wish