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
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ID_ATTRIBUTE_TAG
 
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.
 java.util.Iterator<AIColony> getAIColonyIterator()
          Deprecated. Returns an iterator over all the AIColonys owned by this getPlayer().
 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.
 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.
 AIUnit recruitAIUnitInEurope(int slot)
          Deprecated. Ask the server to recruit a unit in Europe on behalf of the AIPlayer
 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
buyProposition, getAIUnitIterator, getBestTreasureTrain, getConnection, getId, getPlayer, getXMLElementTagName, registerSellGoods, setDebuggingConnection, startWorking
 
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, 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

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


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.

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