public class TagManager extends Manager
A typical usage would be to tag entities such as "PLAYER", "BOSS" or something that is very unique.
| Constructor and Description |
|---|
TagManager()
Creates a new TagManager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deleted(Entity e)
If the entity gets deleted, remove the tag used by it.
|
Entity |
getEntity(String tag)
Get the entity tagged with the given tag.
|
Collection<String> |
getRegisteredTags()
Get all used tags.
|
protected void |
initialize()
Called when the world initializes.
|
boolean |
isRegistered(String tag)
Check if a tag is in use.
|
void |
register(String tag,
Entity e)
Tag an entity.
|
void |
unregister(String tag)
Remove a tag from the entity being tagged with it.
|
public void register(String tag, Entity e)
Each tag can only be given to one entity at a time.
tag - the tage - the entity to get taggedpublic void unregister(String tag)
tag - the tag to removepublic boolean isRegistered(String tag)
tag - the tag to checktrue if the tag is in usepublic Entity getEntity(String tag)
tag - the tag the entity is tagged withpublic Collection<String> getRegisteredTags()
public void deleted(Entity e)
deleted in interface EntityObserverdeleted in class Managere - the deleted entityprotected void initialize()
ManagerOverride to implement custom behavior at initialization.
initialize in class ManagerCopyright © 2014. All Rights Reserved.