|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the interface that represents the client from the server's point of view. The client should keep a list of the pieces added, and their handles, as other methods should affect the pieces, and these methods use the handle as a reference to the pieces.
Method Summary | |
void |
actionReply(long id,
boolean ok,
String message)
Call this to indicate that the executed action with the given id has been finished. |
void |
addPiece(int handle,
String name,
Position pos,
Enumeration actions,
Enumeration properties,
String type)
Creates a new Piece and adds it to the game. |
void |
addPieceAction(int handle,
Action a)
Adds the given action to the list of actions that a piece can do. |
void |
connectionLost()
Called to indicate that the connection to the server has been lost. |
void |
destroyPiece(int handle)
This method is called to indicate that a piece has permanantly left the game. |
void |
invisibilizeMapPoint(Point p)
Makes the given point of the map invisible. |
void |
invisibilizeMapPoints(Point[] points)
Makes the given points of the map invisible. |
void |
mapLoadingProgressUpdate(double progress)
The server calls this method as the initilizing loading of the map progresses. |
void |
mapUpdate(Point[] points,
int[] colors)
Update the given points to the corresponding colors. |
void |
mapUpdate(Point p,
int color)
Update the given point to the given color. |
void |
removePiece(int handle)
Call this method to indicate that a piece is no longer visible and should be removed. |
void |
removePieceAction(int handle,
Action a)
Removes the given action from the list of actions the a piece can do. |
void |
unitMessage(int handle,
String message)
Sends a message that that describes that something has happened to the piece with the given handle. |
void |
updatePiece(int handle,
Position newPosition)
Sets a new position for the piece with the given handle. |
void |
updatePiece(int handle,
Property[] newProperties)
Adds/changed the given properties of the piece with the given handle. |
Method Detail |
public void mapUpdate(Point[] points, int[] colors)
points
- Description of Parametercolors
- Description of Parameterpublic void mapUpdate(Point p, int color)
p
- Description of Parametercolor
- Description of Parameterpublic void invisibilizeMapPoints(Point[] points)
points
- Description of Parameterpublic void invisibilizeMapPoint(Point p)
p
- Description of Parameterpublic void addPiece(int handle, String name, Position pos, Enumeration actions, Enumeration properties, String type)
handle
- The unique handle of the new Piece.name
- The name of the Piece.pos
- The position of the new Piece.actions
- The actions of the Piece.properties
- The properties of the Piece.type
- The type of Piece. Type is not a property of a Piece,
but the type is used to determine the symbol to use. Make sure the
SymbolFactory has a symbol for this type of Piece.public void updatePiece(int handle, Property[] newProperties)
handle
- Description of ParameternewProperties
- Description of Parameterpublic void updatePiece(int handle, Position newPosition)
handle
- Description of ParameternewPosition
- Description of Parameterpublic void removePiece(int handle)
handle
- Description of Parameterpublic void destroyPiece(int handle)
handle
- Description of Parameterpublic void addPieceAction(int handle, Action a)
handle
- The feature to be added to the PieceAction attributea
- The feature to be added to the PieceAction attributepublic void removePieceAction(int handle, Action a)
handle
- Description of Parametera
- Description of Parameterpublic void actionReply(long id, boolean ok, String message)
id
- The id of the executing action (as returned by the
server, see Server.java).ok
- Did the action execute correctly, or was there an error?message
- A message that describes what happened when the action
was finished.public void unitMessage(int handle, String message)
handle
- Description of Parametermessage
- Description of Parameterpublic void connectionLost()
public void mapLoadingProgressUpdate(double progress)
progress
- A number between 0 and 1 indicating how much of the map
that has been loaded. (0 = nothing, 1 = all).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |