ballwar.model
Interface IPlayer


public interface IPlayer

Interface that represents a single player that has a name and a score and is associated wtih a particular set of movement keys.


Field Summary
static IPlayer NullPlayer
          Null object IPlayer singleton instance that does nothing.
 
Method Summary
 IMovementKeys getMovementKeys()
          Get the set of movement keys associated with this player.
 String getName()
          Get the player's name.
 int getScore()
          Get the player's score
 void setMovementKeys(IMovementKeys keys)
          Set the set of movement keys to be associated with this player.
 void setScore(int score)
          Sets the player's score (integer value).
 

Field Detail

NullPlayer

static final IPlayer NullPlayer
Null object IPlayer singleton instance that does nothing. Score = 0 always, Name = "", movement keys = null always.

Method Detail

getScore

int getScore()
Get the player's score

Returns:
The player's score.

setScore

void setScore(int score)
Sets the player's score (integer value).

Parameters:
score - The new score.

getName

String getName()
Get the player's name.

Returns:
The player's name.

getMovementKeys

IMovementKeys getMovementKeys()
Get the set of movement keys associated with this player.

Returns:
The IMovement keys object for this player.

setMovementKeys

void setMovementKeys(IMovementKeys keys)
Set the set of movement keys to be associated with this player.

Parameters:
keys - The new IMovementKeys object for this player.