|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IPictionaryClientCallback
An interface defining the methods which an pictionary client should implement,
these methods are called by PictionaryClient
and implemented by PictionaryClientGUI
.
Method Summary | |
---|---|
void |
aClientConnected(java.lang.String client)
This method is called when a new client has connected to the server. |
void |
aClientDisconnected(java.lang.String client)
This method is called when a client has disconnected from the server. |
void |
clientBroadcastMessageReceived(java.lang.String client,
java.lang.String message)
This method is called when a message from a client, broadcasted to all other clients, is received. |
void |
clientStartedDrawing(java.lang.String client)
This method is called when a client has started drawing. |
void |
closedByError(java.lang.String error)
This method is called when the connection to the server has been closed. |
void |
connectedToServer()
This method is called when the player successfully connected to a server. |
void |
correctGuess()
This method is called when the player has made a correct guess. |
void |
correctGuessBroadcastReceived(java.lang.String player,
java.lang.String guess)
This method is called to notify the client that a player made a correct guess. |
void |
drawReceived(java.awt.Point point)
This method is called to notify the client that the drawing player drew at a specific point. |
void |
joinedNewGame(java.util.List<java.lang.String> players,
int gameStatus)
This method is called when the client successfully joined a game of Pictionary. |
void |
serverDisconnected()
This method is called when the connection to the server is lost. |
void |
serverMessageReceived(java.lang.String message)
This method is called when a message from the server sent to all the clients is received. |
void |
startDrawing(java.lang.String wordToDraw,
int timeLimit)
This method is called when the player should start drawing a word. |
void |
startGuessing()
This method is called to notify the client that a player is drawing and that the client can start making guesses. |
void |
stopDrawing()
This method is called to notify the client that it should stop drawing. |
void |
stopGuessing()
This method is called to notify the client that it should stop guessing, for example when someone made a correct guess or when the drawing player's time is up. |
java.lang.String |
userNameRequest()
This method is called when the server has requested the client to respond with an username. |
void |
wrongGuessBroadcastReceived(java.lang.String player,
java.lang.String guess)
This method notifies the client that a player made an incorrect guess. |
Method Detail |
---|
void serverMessageReceived(java.lang.String message)
message
- The Message
sent from the server.void clientBroadcastMessageReceived(java.lang.String client, java.lang.String message)
client
- The name of the client that sent the message.message
- The Message
sent from
void aClientConnected(java.lang.String client)
client
- The name of the new client that connected.void aClientDisconnected(java.lang.String client)
client
- The name of the client that disconnected.void joinedNewGame(java.util.List<java.lang.String> players, int gameStatus)
players
- All the players participating in the game.gameStatus
- The status of the game, equal to a status int in PictionaryGame
.void startDrawing(java.lang.String wordToDraw, int timeLimit)
wordToDraw
- The word that the player should attempt to draw.timeLimit
- The amount of time, in seconds, the player can draw before his time is up.void serverDisconnected()
void drawReceived(java.awt.Point point)
point
- A Point
containing the coordinates that were filled.void stopDrawing()
void startGuessing()
void stopGuessing()
void correctGuessBroadcastReceived(java.lang.String player, java.lang.String guess)
player
- The name of the player that made the correct guess.guess
- The guess that was made.void correctGuess()
void wrongGuessBroadcastReceived(java.lang.String player, java.lang.String guess)
player
- The name of the player that made the incorrect guess.guess
- The incorrect guess.void connectedToServer()
java.lang.String userNameRequest()
void clientStartedDrawing(java.lang.String client)
client
- The name of the client that started drawing.void closedByError(java.lang.String error)
error
- A description of the cause to the error.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |