org.dartra.standard
Class StandardPlayer

java.lang.Object
  extended byorg.dartra.standard.PersistentObject
      extended byorg.dartra.standard.StandardPlayer
All Implemented Interfaces:
Persistent, Player
Direct Known Subclasses:
StandardTeam

public class StandardPlayer
extends PersistentObject
implements Player

Standard implementation of the Player interface.

Author:
Erwin Vervaet

Constructor Summary
StandardPlayer(User user, int handicap, DartsSet dartsSet)
           
 
Method Summary
 DartsSet getDartsSet()
          Returns the set of darts used by the player.
 Game getGame()
          Returns the Game this player is participating in.
 int getHandicap()
          Returns the handicap setting for this player.
 Team getTeam()
          Return the player's team, or null if the player is not a member of a team.
 User getUser()
          Returns the User object associated with this player.
 void setGame(Game game)
          Set the game this user is participating in.
 void setTeam(Team team)
          Set the team that this player is a member of, or null if this player is not a member of a team.
 java.lang.String toString()
           
 
Methods inherited from class org.dartra.standard.PersistentObject
getId, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.dartra.framework.Persistent
getId, setId
 

Constructor Detail

StandardPlayer

public StandardPlayer(User user,
                      int handicap,
                      DartsSet dartsSet)
Method Detail

getUser

public User getUser()
Description copied from interface: Player

Returns the User object associated with this player.

Specified by:
getUser in interface Player

setGame

public void setGame(Game game)
Description copied from interface: Player

Set the game this user is participating in.

Implementations should make sure that it is not possible to change the game a user is participating in! This is particularly imporant for matches. The player will participate first and foremost in the match. He or she will also play the games of that match. However, that should have no impact on the game the player is linked with, which will be the match itself.

Specified by:
setGame in interface Player

getGame

public Game getGame()
Description copied from interface: Player

Returns the Game this player is participating in.

Specified by:
getGame in interface Player

setTeam

public void setTeam(Team team)
Description copied from interface: Player

Set the team that this player is a member of, or null if this player is not a member of a team.

Specified by:
setTeam in interface Player

getTeam

public Team getTeam()
Description copied from interface: Player

Return the player's team, or null if the player is not a member of a team.

Specified by:
getTeam in interface Player

getHandicap

public int getHandicap()
Description copied from interface: Player

Returns the handicap setting for this player. The way this is used depends on the game the player is participating in.

Specified by:
getHandicap in interface Player

getDartsSet

public DartsSet getDartsSet()
Description copied from interface: Player

Returns the set of darts used by the player.

Specified by:
getDartsSet in interface Player

toString

public java.lang.String toString()