Interface IPlayer

All Known Subinterfaces:
IAutoPlayer
All Known Implementing Classes:
AbstractAutoPlayer, AbstractPlayer, BadAutoPlayer, HumanPlayer

public interface IPlayer

A Boggle player must support the methods of this interface. Each player has an associated model and a view. Players add words, e.g., human players might enter a string of text and computer players might find words on an associated model's board.

Author:
Owen Astrachan

Method Summary
 void add(java.lang.String word)
          Add a word for the player.
 java.lang.String getName()
          Return the name of a player.
 int getScore()
          Get the score for this player, see BoggleModel for how scores are calculated.
 void initialize(BoggleModel model)
          Initialize a player with a model, the model will serve this player for potentially more than one game.
 void setView(IPlayerView view)
          Specify a view for this player, the view is potentially used to show errors, highlight cubes for a word, and so on.
 

Method Detail

initialize

void initialize(BoggleModel model)
Initialize a player with a model, the model will serve this player for potentially more than one game.

Parameters:
model - is the BoggleModel for this player

setView

void setView(IPlayerView view)
Specify a view for this player, the view is potentially used to show errors, highlight cubes for a word, and so on.

Parameters:
view -

getScore

int getScore()
Get the score for this player, see BoggleModel for how scores are calculated.

Returns:
current score for this player

add

void add(java.lang.String word)
Add a word for the player. The player may choose to ignore duplicate words, skip words not in the lexicon, or to check these.

Parameters:
word -

getName

java.lang.String getName()
Return the name of a player.

Returns:
this player's name