|
||||||||||
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 |
---|
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 AIColony s owned by this
getPlayer(). |
java.util.Iterator<TileImprovementPlan> |
getTileImprovementPlanIterator()
Deprecated. Returns an Iterator over all the
TileImprovement s 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 java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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)
public java.util.Iterator<TileImprovementPlan> getTileImprovementPlanIterator()
Iterator
over all the
TileImprovement
s needed by all of this player's colonies.
Iterator
.TileImprovement
public boolean hasFewColonies()
true
if the AI should build more colonies.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()
AIColony
s 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 |