|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.server.ai.AIMessage
public class AIMessage
Wrapper class for AI message handling.
| Field Summary | |
|---|---|
private static java.util.logging.Logger |
logger
|
| Constructor Summary | |
|---|---|
AIMessage()
|
|
| Method Summary | |
|---|---|
static boolean |
askAttack(AIUnit aiUnit,
Map.Direction direction)
An AIUnit attacks in the given direction. |
static boolean |
askBuildColony(AIUnit aiUnit,
java.lang.String name)
An AIUnit builds a colony. |
static boolean |
askBuyGoods(AIUnit aiUnit,
GoodsType type,
int amount)
An AIUnit buys goods. |
static boolean |
askCashInTreasureTrain(AIUnit aiUnit)
An AIUnit cashes in. |
static boolean |
askChangeState(AIUnit aiUnit,
Unit.UnitState state)
An AIUnit changes state. |
static boolean |
askChangeWorkImprovementType(AIUnit aiUnit,
TileImprovementType type)
An AIUnit changes its work improvement type. |
static boolean |
askChangeWorkType(AIUnit aiUnit,
GoodsType type)
An AIUnit changes its work type. |
static boolean |
askClaimLand(Connection conn,
Tile tile,
Colony colony,
int price)
Claims a tile for a colony. |
static boolean |
askClearSpeciality(AIUnit aiUnit)
Clears the speciality of a unit. |
static boolean |
askCloseTransaction(AIUnit aiUnit,
Settlement settlement)
An AIUnit closes a transaction. |
static boolean |
askDeliverGift(AIUnit aiUnit,
Settlement settlement,
Goods goods)
An AIUnit delivers a gift. |
static boolean |
askDisembark(AIUnit aiUnit)
An AIUnit disembarks. |
static boolean |
askEmbark(AIUnit aiUnit,
Unit unit,
Map.Direction direction)
An AIUnit embarks. |
static boolean |
askEmigrate(Connection connection,
int slot)
A unit in Europe emigrates. |
static boolean |
askEndTurn(Connection connection)
Ends the player turn. |
static boolean |
askEquipUnit(AIUnit aiUnit,
EquipmentType type,
int amount)
Change the equipment of a unit. |
static boolean |
askEstablishMission(AIUnit aiUnit,
Map.Direction direction,
boolean denounce)
Establishes a mission in the given direction. |
static boolean |
askGetTransaction(AIUnit aiUnit,
Settlement settlement)
An AIUnit gets a transaction. |
static boolean |
askIndianDemand(AIUnit aiUnit,
Colony colony,
Goods goods,
int gold)
Makes demands to a colony. |
static boolean |
askLoadCargo(AIUnit aiUnit,
Goods goods)
An AI unit loads some cargo. |
static boolean |
askLoot(AIUnit aiUnit,
java.lang.String defenderId,
java.util.List<Goods> goods)
An AI unit loots some cargo. |
private static org.w3c.dom.Element |
askMessage(Connection connection,
org.w3c.dom.Element request)
Ask the server a question. |
static boolean |
askMove(AIUnit aiUnit,
Map.Direction direction)
Moves an AIUnit in the given direction. |
static boolean |
askMoveTo(AIUnit aiUnit,
Location destination)
Moves an AIUnit across the high seas. |
static boolean |
askPutOutsideColony(AIUnit aiUnit)
An AIUnit is put outside a colony. |
static boolean |
askScoutIndianSettlement(AIUnit aiUnit,
Map.Direction direction)
An AI unit scouts a native settlement. |
static boolean |
askSellGoods(AIUnit aiUnit,
Goods goods)
An AI unit sells some cargo. |
static boolean |
askSetBuildQueue(AIColony aiColony,
java.util.List<BuildableType> queue)
Set the build queue in a colony. |
static boolean |
askTrainUnitInEurope(Connection connection,
UnitType type)
Train unit in Europe. |
static boolean |
askUnloadCargo(AIUnit aiUnit,
Goods goods)
An AI unit unloads some cargo. |
static boolean |
askWork(AIUnit aiUnit,
WorkLocation workLocation)
Set a unit to work in a work location. |
static org.w3c.dom.Element |
makeTrivial(java.lang.String tag,
java.lang.String... attributes)
Make a trivial message. |
private static boolean |
sendMessage(Connection connection,
DOMMessage message)
Send a message to the server. |
private static boolean |
sendMessage(Connection connection,
org.w3c.dom.Element request)
Sends a DOMMessage to the server. |
static boolean |
sendTrivial(Connection connection,
java.lang.String tag,
java.lang.String... attributes)
Send a trivial message. |
| 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 AIMessage()
| Method Detail |
|---|
private static org.w3c.dom.Element askMessage(Connection connection,
org.w3c.dom.Element request)
connection - The Connection to use
when communicating with the server.request - The Element to send.
private static boolean sendMessage(Connection connection,
org.w3c.dom.Element request)
connection - The Connection to use
when communicating with the server.request - The Element to send.
private static boolean sendMessage(Connection connection,
DOMMessage message)
connection - The Connection to use
when communicating with the server.message - The Message to send.
public static boolean sendTrivial(Connection connection,
java.lang.String tag,
java.lang.String... attributes)
connection - The Connection to send on.tag - The tag of the message.attributes - Attributes to add to the message.
public static org.w3c.dom.Element makeTrivial(java.lang.String tag,
java.lang.String... attributes)
tag - The tag of the message.attributes - Attributes to add to the message.
public static boolean askAttack(AIUnit aiUnit,
Map.Direction direction)
aiUnit - The AIUnit to attack with.direction - The Direction to attack in.
public static boolean askBuildColony(AIUnit aiUnit,
java.lang.String name)
aiUnit - The AIUnit to build the colony.name - The name of the colony.
public static boolean askBuyGoods(AIUnit aiUnit,
GoodsType type,
int amount)
aiUnit - The AIUnit buys goods.type - The GoodsType to buy.amount - The amount of goods to buy.
public static boolean askCashInTreasureTrain(AIUnit aiUnit)
aiUnit - The AIUnit cashing in.
public static boolean askChangeState(AIUnit aiUnit,
Unit.UnitState state)
aiUnit - The AIUnit to change the state of.state - The new UnitState.
public static boolean askChangeWorkType(AIUnit aiUnit,
GoodsType type)
aiUnit - The AIUnit to change the work type of.type - The GoodsType to produce.
public static boolean askChangeWorkImprovementType(AIUnit aiUnit,
TileImprovementType type)
aiUnit - The AIUnit to change the work type of.type - The TileImprovementType to produce.
public static boolean askClaimLand(Connection conn,
Tile tile,
Colony colony,
int price)
conn - The Connection to send on.tile - The Tile to claim.colony - The Colony claiming the tile.price - The price to pay.
public static boolean askClearSpeciality(AIUnit aiUnit)
aiUnit - The AIUnit to clear.
public static boolean askCloseTransaction(AIUnit aiUnit,
Settlement settlement)
aiUnit - The AIUnit that closes the transaction.settlement - The target Settlement.
public static boolean askDeliverGift(AIUnit aiUnit,
Settlement settlement,
Goods goods)
aiUnit - The AIUnit delivering the gift.settlement - The Settlement to give to.goods - The Goods to give.
public static boolean askDisembark(AIUnit aiUnit)
aiUnit - The AIUnit delivering the gift.
public static boolean askEmbark(AIUnit aiUnit,
Unit unit,
Map.Direction direction)
aiUnit - The AIUnit carrier.unit - The Unit that is embarking.direction - The Direction to embark in (may be null).
public static boolean askEmigrate(Connection connection,
int slot)
connection - The Connection to the server.slot - The slot to emigrate from.
public static boolean askEndTurn(Connection connection)
connection - The Connection to the server.
public static boolean askEquipUnit(AIUnit aiUnit,
EquipmentType type,
int amount)
aiUnit - The AIUnit to equip.type - The EquipmentType to equip with.amount - The amount to change the equipment by.
public static boolean askEstablishMission(AIUnit aiUnit,
Map.Direction direction,
boolean denounce)
aiUnit - The AIUnit establishing the mission.direction - The Direction to move the unit.denounce - Is this a denunciation?
public static boolean askGetTransaction(AIUnit aiUnit,
Settlement settlement)
aiUnit - The AIUnit that gets a transaction.settlement - The target Settlement.
public static boolean askIndianDemand(AIUnit aiUnit,
Colony colony,
Goods goods,
int gold)
aiUnit - The AIUnit that is demanding.colony - The Colony to demand of.goods - The Goods to demand.gold - The amount of gold to demand.
public static boolean askLoadCargo(AIUnit aiUnit,
Goods goods)
aiUnit - The AIUnit that is loading.goods - The Goods to load.
public static boolean askLoot(AIUnit aiUnit,
java.lang.String defenderId,
java.util.List<Goods> goods)
aiUnit - The AIUnit that is looting.defenderId - The id of the defending unit.goods - A list of Goods to loot.
public static boolean askMove(AIUnit aiUnit,
Map.Direction direction)
aiUnit - The AIUnit to move.direction - The Direction to move the unit.
public static boolean askMoveTo(AIUnit aiUnit,
Location destination)
aiUnit - The AIUnit to move.destination - The Location to move to.
public static boolean askPutOutsideColony(AIUnit aiUnit)
aiUnit - The AIUnit to put out.
public static boolean askScoutIndianSettlement(AIUnit aiUnit,
Map.Direction direction)
aiUnit - The AIUnit that is scouting.direction - The Direction to move.
public static boolean askSellGoods(AIUnit aiUnit,
Goods goods)
aiUnit - The AIUnit that is selling.goods - The Goods to sell.
public static boolean askSetBuildQueue(AIColony aiColony,
java.util.List<BuildableType> queue)
aiColony - The AIColony that is building.queue - The list of BuildableTypes to build.
public static boolean askTrainUnitInEurope(Connection connection,
UnitType type)
connection - The Connection to the server.type - The UnitType to train.
public static boolean askUnloadCargo(AIUnit aiUnit,
Goods goods)
aiUnit - The AIUnit that is unloading.goods - The Goods to unload.
public static boolean askWork(AIUnit aiUnit,
WorkLocation workLocation)
aiUnit - The AIUnit to work.workLocation - The WorkLocation to work in.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||