| Modifier and Type | Field and Description |
|---|---|
private String |
emailId
Email id of the gamer.
|
private Object |
id
This variable could be used as a database key.
|
private String |
name
The name of the gamer.
|
private Set<PlayerSession> |
playerSessions
One player can be connected to multiple games at the same time.
|
| Constructor and Description |
|---|
DefaultPlayer() |
DefaultPlayer(Object id,
String name,
String emailId) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addSession(PlayerSession session)
Add a session to a player.
|
boolean |
equals(Object obj) |
String |
getEmailId()
Method used to get the email id of the gamer.
|
Object |
getId()
A unique key representing a gamer.
|
String |
getName()
Method used to get the name of the gamer.
|
Set<PlayerSession> |
getPlayerSessions() |
int |
hashCode() |
void |
logout(PlayerSession session)
When a player logs out, this method can be called.
|
boolean |
removeSession(PlayerSession session)
Remove the players session to a game.
|
void |
setEmailId(String emailId)
Method used to set the email id of the gamer.
|
void |
setId(Object id)
A unique key representing a gamer.
|
void |
setName(String name)
Method used to set the name of the gamer.
|
void |
setPlayerSessions(Set<PlayerSession> playerSessions) |
private Object id
private String name
private String emailId
private Set<PlayerSession> playerSessions
public Object getId()
Playerpublic void setId(Object id)
Playerpublic String getName()
Playerpublic void setName(String name)
Playerpublic String getEmailId()
PlayergetEmailId in interface Playerpublic void setEmailId(String emailId)
PlayersetEmailId in interface PlayeremailId - Sets the email id string. strings more than 50 characters long
may be rejected.public boolean addSession(PlayerSession session)
PlayeraddSession in interface Playersession - The session to add.public boolean removeSession(PlayerSession session)
PlayerremoveSession in interface Playersession - The session to remove.public void logout(PlayerSession session)
Playerpublic Set<PlayerSession> getPlayerSessions()
public void setPlayerSessions(Set<PlayerSession> playerSessions)
Copyright © 2013. All Rights Reserved.