|
|||||||||
| 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.NewAIPlayer
net.sf.freecol.server.ai.EuropeanAIPlayer
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
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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.util.logging.Logger logger
| Constructor Detail |
|---|
public EuropeanAIPlayer()
| Method Detail |
|---|
public boolean hasManOfWar()
true if this player owns
a single Man-of-War.public AIUnit trainAIUnitInEurope(UnitType unitType)
public AIUnit recruitAIUnitInEurope(int slot)
protected void ensureCorrectMissions()
WorkInsideColonyMission.
protected void giveNavalMissions()
protected void rearrangeWorkersInColonies()
AIColony.rearrangeWorkers(net.sf.freecol.common.networking.Connection) for every colony this player
owns.
protected void secureSettlements()
protected void secureColony(Colony colony)
protected void createAIGoodsInColonies()
AIColony.createAIGoods() for every colony this player owns.
int getDefendColonyMissionValue(Unit u,
Colony colony,
int turns)
void giveMilitaryMission(AIUnit aiUnit)
Mission to the given unit.
aiUnit - The unit.public java.util.Iterator<TileImprovementPlan> getTileImprovementPlanIterator()
Iterator over all the
TileImprovements needed by all of this player's colonies.
Iterator.TileImprovementpublic boolean hasFewColonies()
true if the AI should build more colonies.protected void createTransportLists()
Transportables to carrier's using a
TransportMission.
public int tradeProposition(Unit unit,
Settlement settlement,
Goods goods,
int gold)
Player proposes a trade.
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.
AIPlayer suggests or
NetworkConstants.NO_TRADE.
public abstract boolean acceptIndianDemand(Unit unit,
Colony colony,
Goods goods,
int gold)
unit - The unit making demands.colony - The colony where demands are being made.goods - The goods demanded.gold - The amount of gold demanded.
true if this AIPlayer accepts the
indian demand and false otherwise.public java.util.Iterator<AIColony> getAIColonyIterator()
AIColonys owned by this
getPlayer().
Iterator.public java.util.Iterator<Wish> getWishIterator()
Iterator for all the wishes. The items are
sorted by the value, with the item having the
highest value appearing first in the Iterator.
Iterator.Wish
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||