public class PlayerManager extends Manager
An entity can only belong to a single player at a time.
| Constructor and Description |
|---|
PlayerManager()
Creates a new PlayerManager instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deleted(Entity e)
Deleted entities are removed from their player.
|
ImmutableBag<Entity> |
getEntitiesOfPlayer(String player)
Get all entities belonging to a player.
|
String |
getPlayer(Entity e)
Get the player an entity is associated with.
|
protected void |
initialize()
Called when the world initializes.
|
void |
removeFromPlayer(Entity e)
Remove the association of an entity with a player.
|
void |
setPlayer(Entity e,
String player)
Associate the entity with the specified player.
|
public void setPlayer(Entity e, String player)
Each entity may only be assoctiated with one player at a time.
e - the entity to associateplayer - the player to associtate to the entity withpublic ImmutableBag<Entity> getEntitiesOfPlayer(String player)
player - the playerpublic void removeFromPlayer(Entity e)
e - the entity to removepublic String getPlayer(Entity e)
e - the entity to get the player forprotected void initialize()
ManagerOverride to implement custom behavior at initialization.
initialize in class Managerpublic void deleted(Entity e)
deleted in interface EntityObserverdeleted in class Managere - the deleted entityCopyright © 2014. All Rights Reserved.