|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gecco.communication.client.ServerAmbassador
This is the class that implements gecco.client.Server, and is the only part of the communication the client knows of.
Constructor Summary | |
ServerAmbassador(Client cl)
|
Method Summary | |
void |
abortAction(long actionId)
Called by the client when it wants a unit to abort an action |
boolean |
connect(String host,
int port)
tries to connect to the server returns false if failed to connect |
void |
connectionLost()
Called whenever a communication error occurs. |
void |
disconnect()
Called by the client when it wants to disconnect |
long |
doAction(int pieceHandle,
Action a)
Called by the client when it wants a unit to perform an action. |
Set |
getAvailableRoles()
asks the server which roles are available for this client to join as |
BufferedImage |
getMap()
Called by the client when it wants to get the whole map |
boolean |
joinAsRole(String role)
Tells the server that the client wants to join the game. |
void |
startGame()
Called by the client when it is ready to receive messages from the server |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ServerAmbassador(Client cl)
cl
- The object that implements gecco.client.Client, and the only
part of the client that the communication part is aware ofMethod Detail |
public Set getAvailableRoles()
getAvailableRoles
in interface Server
public BufferedImage getMap()
getMap
in interface Server
public boolean connect(String host, int port)
connect
in interface Server
host
- The name of the host where to find the serverport
- The port number to connect topublic boolean joinAsRole(String role)
joinAsRole
in interface Server
role
- The role this client wants to join aspublic void connectionLost()
public long doAction(int pieceHandle, Action a)
doAction
in interface Server
pieceHandle
- Description of Parametera
- Description of Parameterpublic void abortAction(long actionId)
abortAction
in interface Server
actionId
- Description of Parameterpublic void disconnect()
disconnect
in interface Server
public void startGame()
startGame
in interface Server
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |