Interface IPlayer

All Superinterfaces:
java.lang.Iterable<java.lang.String>
All Known Subinterfaces:
IAutoPlayer
All Known Implementing Classes:
AbstractAutoPlayer, AbstractPlayer, BadAutoPlayer, BoardFirstAutoPlayer, HumanPlayer, LexiconFirstAutoPlayer

public interface IPlayer
extends java.lang.Iterable<java.lang.String>

A Boggle player must support the methods of this interface. Each player has an associated view. Players add words, e.g., human players might enter a string of text and computer players might find words on a board passed to a computer player method. (See IAutoPlayer).


Method Summary
 boolean add(java.lang.String word)
          Add a word for the player.
 void clear()
          Clear state of a player, e.g., as in a new game.
 java.lang.String getName()
          Return the name of a player.
 int getScore()
          Get the score for this player, see BoggleScore for how scores are calculated.
 void initialize(ILexicon lex)
          Initialize a player with a Lexicon which could serve this player for 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.
 int wordCount()
          Return number of unique words added by this player.
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

initialize

void initialize(ILexicon lex)
Initialize a player with a Lexicon which could serve this player for more than one game

Parameters:
lex - is the Lexicon 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 BoggleScore for how scores are calculated.

Returns:
current score for this player

add

boolean 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 -
Returns:
TODO

getName

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

Returns:
this player's name

clear

void clear()
Clear state of a player, e.g., as in a new game.


wordCount

int wordCount()
Return number of unique words added by this player.

Returns:
number of words