|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectunc.cdva.utils.TaggedObject
unc.cdva.gameengine.entities.Player
public class Player
Abstract representation of a player, or a user. Use to encapsulate the attributes of a player. Implemented with a bean design.
Constructor Summary | |
---|---|
Player()
Initializes a player object, starts the level and score at zero, and tags the player as active. |
Method Summary | |
---|---|
void |
addToScore(long score)
Increases the players score. |
boolean |
equals(java.lang.Object o)
Returns true if the parameter is a player object that has the same id as this player object. |
long |
getHighScore()
|
int |
getLevel()
|
long |
getScore()
|
void |
init()
Resets a player object, the player will have no score and will be on the first level. |
boolean |
isActive()
A getter method for the active property of Player. |
boolean |
isFiring()
|
void |
nextLevel()
Increments the level property by one. |
void |
setActive(boolean active)
Setter for the active property of Player. |
void |
setFiring(boolean firing)
|
void |
setHighScore(long hiScore)
|
void |
setLevel(int level)
|
void |
setScore(long score)
|
Methods inherited from class unc.cdva.utils.TaggedObject |
---|
createId, getId, hashCode, setId, setId |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Player()
Method Detail |
---|
public void init()
public boolean equals(java.lang.Object o)
equals
in class TaggedObject
public boolean isActive()
public void setActive(boolean active)
active
- Pass in false to indicate that the player
is not active, true to indicate the player is still active.public void addToScore(long score)
score
- The amount to increase the players score by.public long getHighScore()
public int getLevel()
public long getScore()
public void setHighScore(long hiScore)
hiScore
- the hiScore to setpublic void setLevel(int level)
level
- the level to setpublic void setScore(long score)
score
- the score to setpublic void nextLevel()
public boolean isFiring()
public void setFiring(boolean firing)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |