jrummikub.model
Class Player

java.lang.Object
  extended by jrummikub.model.Player
All Implemented Interfaces:
java.io.Serializable, IPlayer

public class Player
extends java.lang.Object
implements IPlayer

Class managing player data. No methods in release 1

See Also:
Serialized Form

Field Summary
private  IHand hand
           
private  boolean laidOut
           
private  boolean lastTurnInvalid
           
private  int lastTurnStoneCount
           
private static long serialVersionUID
           
private  PlayerSettings settings
           
 
Constructor Summary
Player(PlayerSettings settings)
          Create a new player with a given name and color
 
Method Summary
 IHand getHand()
          Get the current hand of the player
 boolean getLaidOut()
          Has the player laid out yet?
 int getLastTurnStoneCount()
          Gets the number of stones put on table in player's last turn
 PlayerSettings getPlayerSettings()
          Returns the player settings
 void setHand(IHand hand)
          Set the current hand of the player
 void setLaidOut(boolean laidOut)
          Set if the player laid out
 void setLastTurnInvalid(boolean value)
          Sets last turn invalid
 void setLastTurnStoneCount(int value)
          Sets the number of stones out on the table in player's last turn
 boolean wasLastTurnInvalid()
          Getter for last turn invalid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

settings

private PlayerSettings settings

hand

private IHand hand

laidOut

private boolean laidOut

lastTurnInvalid

private boolean lastTurnInvalid

lastTurnStoneCount

private int lastTurnStoneCount
Constructor Detail

Player

public Player(PlayerSettings settings)
Create a new player with a given name and color

Parameters:
settings - the player settings
Method Detail

getHand

public IHand getHand()
Description copied from interface: IPlayer
Get the current hand of the player

Specified by:
getHand in interface IPlayer
Returns:
the player's hand

setHand

public void setHand(IHand hand)
Description copied from interface: IPlayer
Set the current hand of the player

Specified by:
setHand in interface IPlayer
Parameters:
hand - the new hand

getLaidOut

public boolean getLaidOut()
Description copied from interface: IPlayer
Has the player laid out yet?

Specified by:
getLaidOut in interface IPlayer
Returns:
if the player has laid out

setLaidOut

public void setLaidOut(boolean laidOut)
Description copied from interface: IPlayer
Set if the player laid out

Specified by:
setLaidOut in interface IPlayer
Parameters:
laidOut - the player laid out

getPlayerSettings

public PlayerSettings getPlayerSettings()
Description copied from interface: IPlayer
Returns the player settings

Specified by:
getPlayerSettings in interface IPlayer
Returns:
the player settings

wasLastTurnInvalid

public boolean wasLastTurnInvalid()
Description copied from interface: IPlayer
Getter for last turn invalid

Specified by:
wasLastTurnInvalid in interface IPlayer
Returns:
last turn invalid

setLastTurnInvalid

public void setLastTurnInvalid(boolean value)
Description copied from interface: IPlayer
Sets last turn invalid

Specified by:
setLastTurnInvalid in interface IPlayer
Parameters:
value - last turn invalid

getLastTurnStoneCount

public int getLastTurnStoneCount()
Description copied from interface: IPlayer
Gets the number of stones put on table in player's last turn

Specified by:
getLastTurnStoneCount in interface IPlayer
Returns:
number of stones

setLastTurnStoneCount

public void setLastTurnStoneCount(int value)
Description copied from interface: IPlayer
Sets the number of stones out on the table in player's last turn

Specified by:
setLastTurnStoneCount in interface IPlayer
Parameters:
value - number of stones