|
|||||||||
| 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.AIPlayer
net.sf.freecol.server.ai.EuropeanAIPlayer
net.sf.freecol.server.ai.REFAIPlayer
public class REFAIPlayer
Objects of this class contains AI-information for a single REF player. For now, mostly just the EuropeanAIPlayer, with a few tweaks.
| Field Summary | |
|---|---|
private static java.util.logging.Logger |
logger
|
| Fields inherited from class net.sf.freecol.server.ai.AIPlayer |
|---|
MAX_DISTANCE_TO_BRING_GIFT, MAX_DISTANCE_TO_MAKE_DEMANDS, MAX_NUMBER_OF_DEMANDS, MAX_NUMBER_OF_GIFTS_BEING_DELIVERED |
| 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, INFINITY, NO_ID, PARTIAL_ATTRIBUTE, UNDEFINED, VALUE_TAG |
| Constructor Summary | |
|---|---|
REFAIPlayer(AIMain aiMain,
org.w3c.dom.Element element)
Creates a new REFAIPlayer and reads the
information from the given Element. |
|
REFAIPlayer(AIMain aiMain,
ServerPlayer player)
Creates a new REFAIPlayer. |
|
REFAIPlayer(AIMain aiMain,
javax.xml.stream.XMLStreamReader in)
Creates a new REFAIPlayer. |
|
| Method Summary | |
|---|---|
private boolean |
alreadySeeking(Unit unit)
Checks if there is already a seek and destroy mission active on for a target unit. |
int |
getDefendColonyMissionValue(Unit unit,
Colony colony,
int turns)
Evaluate allocating a unit to the defence of a colony. |
int |
getUnitSeekAndDestroyMissionValue(Unit unit,
Tile newTile,
int turns)
Evaluate a potential seek and destroy mission for a given unit to a given tile. |
void |
giveNormalMissions()
Gives a mission to non-naval units. |
Tile |
initialize(boolean teleport)
Initialize the REF. |
void |
startWorking()
Tells this REFAIPlayer to make decisions. |
| Methods inherited from class net.sf.freecol.server.ai.EuropeanAIPlayer |
|---|
acceptDiplomaticTrade, acceptMercenaries, acceptTax, buyProposition, chooseMilitaryTarget, getColonyDefenders, getTileImprovementPlans, getWishes, giveMilitaryMission, hasFewColonies, indianDemand, recruitAIUnitInEurope, registerSellGoods, removeTileImprovementPlan, selectFoundingFather, sellProposition, trainAIUnitInEurope |
| Methods inherited from class net.sf.freecol.server.ai.AIPlayer |
|---|
abortInvalidAndOneTimeMissions, abortInvalidMissions, clearAIUnits, determineStance, determineStances, doMissions, getAIAdvantage, getAIColonies, getAIColony, getAIRandom, getAIUnit, getAIUnitIterator, getAIUnits, getConnection, getId, getPlayer, getXMLElementTagName, isTargetValidForSeekAndDestroy, readFromXMLImpl, setDebuggingConnection, setPlayer, toXMLImpl |
| Methods inherited from class net.sf.freecol.server.ai.AIObject |
|---|
dispose, getAIMain, getGame, getSpecification, 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 REFAIPlayer(AIMain aiMain,
ServerPlayer player)
REFAIPlayer.
aiMain - The main AI-class.player - The player that should be associated with this
REFAIPlayer.
public REFAIPlayer(AIMain aiMain,
org.w3c.dom.Element element)
REFAIPlayer and reads the
information from the given Element.
aiMain - The main AI-class.element - The XML-element containing information.
public REFAIPlayer(AIMain aiMain,
javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
REFAIPlayer.
aiMain - The main AI-object.in - The input stream containing the XML.
javax.xml.stream.XMLStreamException - if a problem was encountered during parsing.| Method Detail |
|---|
public void startWorking()
REFAIPlayer to make decisions.
startWorking in class EuropeanAIPlayerpublic Tile initialize(boolean teleport)
teleport - "Teleporting" in is allowed.
public int getDefendColonyMissionValue(Unit unit,
Colony colony,
int turns)
getDefendColonyMissionValue in class EuropeanAIPlayerunit - The Unit that is to defend.colony - The Colony to defend.turns - The turns for the unit to reach the colony.
public int getUnitSeekAndDestroyMissionValue(Unit unit,
Tile newTile,
int turns)
getUnitSeekAndDestroyMissionValue in class EuropeanAIPlayerunit - The Unit to do the mission.newTile - The Tile to go to.turns - How long to travel to the tile.
private boolean alreadySeeking(Unit unit)
unit - The Unit to check if there is a mission for.
public void giveNormalMissions()
giveNormalMissions in class EuropeanAIPlayer
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||