public class PlayerCharacterManager extends BasicCharacterManager implements Serializable
CharacterManager used to manage
PlayerCharacters. This manager can contain any number of
characters, though only one is ever the current one playing.| Constructor and Description |
|---|
PlayerCharacterManager(Player player)
Creates an instance of
PlayerCharacterManager. |
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacter(PlayerCharacter character)
Adds a character to this manager.
|
void |
broadcastUpdates(Collection<BoardSpace> updates)
Sends space updates to the player.
|
int |
getCharacterCount()
Returns the number of characters managed by this class.
|
Set<String> |
getCharacterNames()
Returns the names of the characters managed by this class.
|
Collection<PlayerCharacter> |
getCharacters()
Returns the characters managed by this class.
|
Character |
getCurrentCharacter()
Returns the current character being played through this manager.
|
Player |
getPlayer()
Returns a reference to the
Player that owns this manager. |
void |
removeCharacter(String name)
Tries to remove the given sharacter from the manager.
|
void |
sendBoard(Board board)
Sends the given board to the player.
|
void |
sendCharacter()
Sends the current character's stats to the player.
|
boolean |
setCurrentCharacter(String characterName)
Sets the current character, if the given name is known.
|
equals, getCurrentLevel, getLevelXPos, getLevelYPos, hashCode, setCurrentLevel, setLevelPosition, toStringpublic PlayerCharacterManager(Player player)
PlayerCharacterManager.playerRef - a reference to the owning Playerpublic Player getPlayer()
Player that owns this manager.Playerpublic boolean setCurrentCharacter(String characterName)
characterName - the name of the characterpublic Character getCurrentCharacter()
getCurrentCharacter in interface CharacterManagerpublic int getCharacterCount()
public Collection<PlayerCharacter> getCharacters()
public Set<String> getCharacterNames()
public void addCharacter(PlayerCharacter character)
character - the character to addpublic void removeCharacter(String name)
name - the character to removepublic void sendBoard(Board board)
sendBoard in interface CharacterManagerboard - the board to sendpublic void broadcastUpdates(Collection<BoardSpace> updates)
broadcastUpdates in interface CharacterManagerupdates - the updates to sendpublic void sendCharacter()
Copyright © 2013. All Rights Reserved.