public class PlayerCharacter extends Object implements Character, com.sun.sgs.app.ManagedObject, Serializable
Character used by all
Players.| Constructor and Description |
|---|
PlayerCharacter(Player player,
int id,
CharacterStats stats)
Creates an instance of
PlayerCharacter. |
| Modifier and Type | Method and Description |
|---|---|
LevelBoard.ActionResult |
collidedFrom(Character character)
Called when a character collides into us.
|
boolean |
collidedInto(Character character)
Called when you collide into the character.
|
int |
getID()
Returns this entity's identifier.
|
String |
getName()
Returns the name of this entity.
|
CharacterStats |
getStatistics()
Returns the statistics associated with this character.
|
void |
notifyStatsChanged()
This method tells the character that their stats have changed.
|
void |
sendMessage(String message)
Sends a text message to the character's player.
|
public PlayerCharacter(Player player, int id, CharacterStats stats)
PlayerCharacter.player - the Player that owns this characterid - the identifier for this characterstats - the statistics for this characterpublic int getID()
public String getName()
public CharacterStats getStatistics()
getStatistics in interface Characterpublic void notifyStatsChanged()
notifyStatsChanged in interface Characterpublic LevelBoard.ActionResult collidedFrom(Character character)
collidedInto method, and then
check on the result. Since the player is interactive, we don't
automatically retaliate (although that could easily be added at
this point).collidedFrom in interface Charactercharacter - the character that collided with uspublic boolean collidedInto(Character character)
collidedInto in interface Charactercharacter - the character that we collided withpublic void sendMessage(String message)
sendMessage in interface Charactermessage - the message to sendCopyright © 2013. All Rights Reserved.