public class TagManager extends BaseSystem
A typical usage would be to tag entities such as "PLAYER", "BOSS" or something that is very unique.
world| Constructor and Description |
|---|
TagManager()
Creates a new TagManager.
|
| Modifier and Type | Method and Description |
|---|---|
Entity |
getEntity(String tag)
Get the entity tagged with the given tag.
|
int |
getEntityId(String tag) |
Collection<String> |
getRegisteredTags()
Get all used tags.
|
String |
getTag(Entity entity)
Get the tag the given entity is tagged with.
|
String |
getTag(int entityId) |
protected void |
initialize()
Override to implement code that gets executed when systems are
initialized.
|
boolean |
isRegistered(String tag)
Check if a tag is in use.
|
protected void |
processSystem()
Process the system.
|
void |
register(String tag,
Entity e)
Tag an entity.
|
void |
register(String tag,
int entityId) |
void |
unregister(String tag)
Remove a tag from the entity being tagged with it.
|
begin, checkProcessing, dispose, end, getWorld, isEnabled, process, setEnabled, setWorldprotected void processSystem()
BaseSystemprocessSystem in class BaseSystemprotected void initialize()
BaseSysteminitialize in class BaseSystempublic 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 register(String tag, int entityId)
public 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 int getEntityId(String tag)
public String getTag(Entity entity)
entity - the entitypublic String getTag(int entityId)
public Collection<String> getRegisteredTags()
Copyright © 2019. All rights reserved.