|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpictionary.PictionaryPlayer
public abstract class PictionaryPlayer
This abstract class serves as a foundation for a Pictionary player.
It has methods which enables a PictionaryGame
to interact with it.
Field Summary | |
---|---|
static int |
DRAWING
The player is drawing. |
private int |
score
The player's score. |
static int |
SPECTATING
The playing is in the game, but not yet playing. |
private int |
status
The players current status. |
static int |
WAITING_FOR_TURN
The player is waiting for his turn. |
Constructor Summary | |
---|---|
PictionaryPlayer(int score,
int status)
The constructor. |
Method Summary | |
---|---|
abstract void |
correctGuess(java.lang.String guess)
Informs the player that he made a correct guess. |
abstract void |
correctGuessBroadcast(java.lang.String guessingPlayer,
java.lang.String word)
Informs the player that a player made a correct guess. |
boolean |
equals(java.lang.Object obj)
This method uses String's String.equals(Object) to compare the
value of this player's getClientID() with the
other player's getClientID(). |
abstract void |
gameStarted()
Informs the player that a new game of Pictionary has started. |
abstract java.lang.String |
getClientID()
Gets the player's ID. |
int |
getScore()
Gets the players score. |
int |
getStatus()
Gets the players status. |
abstract void |
playerStartedDrawing(java.lang.String player)
Informs the player that a player started drawing. |
abstract void |
playerStoppedDrawing(java.lang.String player)
Informs the player that a player stopped drawing. |
abstract void |
reportScores(java.util.List<java.lang.String> players,
java.util.List<java.lang.Integer> scores)
Reports the players' scores. |
void |
setScore(int score)
Set this player's score. |
void |
setStatus(int status)
Sets this player's status. |
abstract void |
startDraw(java.lang.String wordToDraw)
Informs the player that it is her turn to start drawing a word. |
abstract void |
startGuessing()
Informs the player that it can start guessing on the word being drawn. |
abstract void |
stopDraw()
Informs the player that its draw turn is over. |
abstract void |
stopGuessing()
Informs the player that the guessing turn is over. |
abstract void |
tellWord(java.lang.String currentWord)
Tells the player the last word. |
abstract void |
wrongGuess(java.lang.String player,
java.lang.String guess)
Informs the player that someone made an incorrect guess. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int WAITING_FOR_TURN
public static final int DRAWING
public static final int SPECTATING
private int score
private int status
WAITING_FOR_TURN
.
Constructor Detail |
---|
public PictionaryPlayer(int score, int status)
score
- The player's score.status
- The player's status.Method Detail |
---|
public boolean equals(java.lang.Object obj)
String.equals(Object)
to compare the
value of this player's getClientID()
with the
other player's getClientID().
equals
in class java.lang.Object
public void setScore(int score)
score
- The new score.public void setStatus(int status)
status
- The new status.public int getScore()
public int getStatus()
public abstract void playerStoppedDrawing(java.lang.String player)
player
- The name of the player that stopped drawing.public abstract void stopDraw()
public abstract void playerStartedDrawing(java.lang.String player)
player
- The name of the player that started drawing.public abstract void startDraw(java.lang.String wordToDraw)
wordToDraw
- The word that the player should attempt to draw.public abstract void startGuessing()
public abstract void gameStarted()
public abstract void correctGuess(java.lang.String guess)
guess
- The guess that was correct.public abstract void correctGuessBroadcast(java.lang.String guessingPlayer, java.lang.String word)
guessingPlayer
- The player that made the guess.word
- The correct word.public abstract java.lang.String getClientID()
public abstract void reportScores(java.util.List<java.lang.String> players, java.util.List<java.lang.Integer> scores)
scores
corresponds to the
player at the same index in players
.
players
- A collection of players.scores
- A collection of scores.public abstract void stopGuessing()
public abstract void wrongGuess(java.lang.String player, java.lang.String guess)
player
- The player that made the guess.guess
- The incorrect guess.public abstract void tellWord(java.lang.String currentWord)
currentWord
- The word that was being drawn.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |