Package net.sf.freecol.server.ai
Class AIServerAPI
- java.lang.Object
-
- net.sf.freecol.common.networking.ServerAPI
-
- net.sf.freecol.server.ai.AIServerAPI
-
public class AIServerAPI extends ServerAPI
Implementation of the ServerAPI for an AI without neither attached GUI nor real connection to the server.
-
-
Constructor Summary
Constructors Constructor Description AIServerAPI(AIPlayer owner)
Create the new AI wrapper for the server API.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Connection
connect(java.lang.String name, java.lang.String host, int port)
Connects a client to host:port (or more).boolean
disconnect()
Disconnect from the server.Connection
getConnection()
Get the connection to communicate with the server.Connection
reconnect()
Reconnect to the server.-
Methods inherited from class net.sf.freecol.common.networking.ServerAPI
abandonColony, answerMonarch, askSkill, assignTeacher, assignTradeRoute, attack, buildColony, cashInTreasureTrain, changeState, changeWorkImprovementType, changeWorkType, chat, chooseFoundingFather, claimTile, clearSpeciality, continuePlaying, declareIndependence, declineMounds, deleteTradeRoute, deliverGiftToSettlement, demandTribute, diplomacy, disbandUnit, disembark, embark, emigrate, endTurn, enterRevengeMode, equipUnitForRole, firstContact, getHighScores, incite, indianDemand, isConnected, joinColony, learnSkill, loadGoods, login, logout, loot, missionary, move, moveTo, nationSummary, nativeGift, nativeTrade, newLandName, newNativeTradeSession, newRegionName, newTradeRoute, payArrears, payForBuilding, putOutsideColony, rearrangeColony, rename, requestLaunch, retire, scoutSettlement, scoutSpeakToChief, setAvailable, setBuildQueue, setColor, setCurrentStop, setDestination, setGoodsLevels, setMessageHandler, setNation, setNationType, setReady, spy, startSkipping, trainUnitInEurope, unloadGoods, updateGameOptions, updateMapGeneratorOptions, updateTradeRoute, work
-
-
-
-
Field Detail
-
owner
private AIPlayer owner
The AI player that owns this wrapper.
-
-
Constructor Detail
-
AIServerAPI
public AIServerAPI(AIPlayer owner)
Create the new AI wrapper for the server API.- Parameters:
owner
- TheAIPlayer
attached to this API.
-
-
Method Detail
-
getConnection
public Connection getConnection()
Get the connection to communicate with the server.- Specified by:
getConnection
in classServerAPI
- Returns:
- The
Connection
to the server.
-
connect
public Connection connect(java.lang.String name, java.lang.String host, int port) throws java.io.IOException
Connects a client to host:port (or more).
-
disconnect
public boolean disconnect()
Disconnect from the server.- Specified by:
disconnect
in classServerAPI
- Returns:
- True if disconnected.
-
reconnect
public Connection reconnect() throws java.io.IOException
Reconnect to the server.
-
-