org.dartra.framework
Interface Player

All Superinterfaces:
Persistent
All Known Subinterfaces:
Team
All Known Implementing Classes:
StandardPlayer, StandardTeam

public interface Player
extends Persistent

A user participating in a game.

A player is possibly a member of a Team.

A player uses a particular set of darts and can also have a handicap setting.

Player objects have reference semantics. Each Player object models a single participation of a User in a Game.

Author:
Erwin Vervaet

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.
 
Methods inherited from interface org.dartra.framework.Persistent
getId, setId
 

Method Detail

getUser

public User getUser()

Returns the User object associated with this player.


setGame

public void setGame(Game game)

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.


getGame

public Game getGame()

Returns the Game this player is participating in.


setTeam

public 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.


getTeam

public Team getTeam()

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


getHandicap

public int getHandicap()

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


getDartsSet

public DartsSet getDartsSet()

Returns the set of darts used by the player.