public class PlayerManager extends Manager
An entity can only belong to a single player at a time.
world
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.
|
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.
|
added, processSystem, registerManager, setWorld
begin, checkProcessing, dispose, end, getWorld, initialize, isEnabled, process, setEnabled
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 forCopyright © 2019. All rights reserved.