net.sf.freecol.server.ai
Class REFAIPlayer

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
                  extended by net.sf.freecol.server.ai.REFAIPlayer

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

public class REFAIPlayer
extends EuropeanAIPlayer

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


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
REFAIPlayer()
          Deprecated.  
 
Method Summary
 boolean acceptIndianDemand(Unit unit, Colony colony, Goods goods, int gold)
          Deprecated. Decides whether to accept an Indian demand, or not.
private  void checkForREFDefeat()
          Deprecated. For REF-players: Checks if we have lost the war of independence.
private  java.util.List<Player> getDominionsAtWar()
          Deprecated. Gets a list of the players this REF player is currently fighting.
private  int getNumberOfKingUnits()
          Deprecated. Gets the number of King's units.
private  void giveNormalMissions()
          Deprecated. Gives a mission to non-naval units.
private  boolean isWorkForREF()
          Deprecated. Checks if this player has work to do (provided it is an REF-player).
 void startWorking()
          Deprecated. Tells this AIPlayer to make decisions.
 
Methods inherited from class net.sf.freecol.server.ai.EuropeanAIPlayer
createAIGoodsInColonies, createTransportLists, ensureCorrectMissions, getAIColonyIterator, getDefendColonyMissionValue, getTileImprovementPlanIterator, getWishIterator, giveMilitaryMission, giveNavalMissions, hasFewColonies, hasManOfWar, rearrangeWorkersInColonies, recruitAIUnitInEurope, secureColony, secureSettlements, tradeProposition, trainAIUnitInEurope
 
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, 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

REFAIPlayer

public REFAIPlayer()
Deprecated. 
Method Detail

startWorking

public void startWorking()
Deprecated. 
Tells this AIPlayer to make decisions. The AIPlayer is done doing work this turn when this method returns.

Specified by:
startWorking in class NewAIPlayer

giveNormalMissions

private void giveNormalMissions()
Deprecated. 
Gives a mission to non-naval units.


getDominionsAtWar

private java.util.List<Player> getDominionsAtWar()
Deprecated. 
Gets a list of the players this REF player is currently fighting.

Returns:
The list. Empty if this is not an REF getPlayer().

getNumberOfKingUnits

private int getNumberOfKingUnits()
Deprecated. 
Gets the number of King's units.

Returns:
The number of units with ability "model.ability.refUnit" this player owns.

checkForREFDefeat

private void checkForREFDefeat()
Deprecated. 
For REF-players: Checks if we have lost the war of independence.


isWorkForREF

private boolean isWorkForREF()
Deprecated. 
Checks if this player has work to do (provided it is an REF-player).

Returns:
true if any of our units are located in the new world or if a puppet-nation has declared independence.

acceptIndianDemand

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

Specified by:
acceptIndianDemand in class EuropeanAIPlayer
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.