bluegammon.logic
Interface PlayerListener

All Known Implementing Classes:
PlayerListenerProxy, RemotePlayer

public interface PlayerListener

Implementations of this class can be registered in the Player and will receive events upon player actions.

Author:
Peter Andersson

Field Summary
static int LOCAL_GIVE_UP
          Constant denoting a game exit on local user giving up
static int LOCAL_QUIT
          Constant denoting a game exit on user quitting
static int REMOTE_GIVE_UP
          Constant denoting a game exit on remote user giving up
static int REMOTE_QUIT
          Constant denoting a game exit on remote user quitting
 
Method Summary
 void gameExited(int id, int reason)
          Called when player exits the game for some reason.
 void messageSent(int id, char[] msg)
          Called when player sent a message.
 void moveMade(int id, int moveIndex)
          Called when a player performs a move.
 void turnCommit(int id)
          Called when player is finished with his/her turn.
 void undoPerformed(int id)
          Called when player performs an undo.
 

Field Detail

LOCAL_QUIT

public static final int LOCAL_QUIT
Constant denoting a game exit on user quitting

See Also:
Constant Field Values

REMOTE_QUIT

public static final int REMOTE_QUIT
Constant denoting a game exit on remote user quitting

See Also:
Constant Field Values

LOCAL_GIVE_UP

public static final int LOCAL_GIVE_UP
Constant denoting a game exit on local user giving up

See Also:
Constant Field Values

REMOTE_GIVE_UP

public static final int REMOTE_GIVE_UP
Constant denoting a game exit on remote user giving up

See Also:
Constant Field Values
Method Detail

moveMade

public void moveMade(int id,
                     int moveIndex)
Called when a player performs a move.

Parameters:
id - Player id.
moveIndex - The moveindex in possible move array used for move.

undoPerformed

public void undoPerformed(int id)
Called when player performs an undo.

Parameters:
id - Player id.

turnCommit

public void turnCommit(int id)
Called when player is finished with his/her turn.

Parameters:
id - Player id.

messageSent

public void messageSent(int id,
                        char[] msg)
Called when player sent a message.

Parameters:
id - Player id.
msg - The message.

gameExited

public void gameExited(int id,
                       int reason)
Called when player exits the game for some reason.

Parameters:
id - Player id.
reason - The reason for exiting game.