GroupManager class
If you need to group your entities together, e.g. tanks going into "units" group or explosions into "effects", then use this manager. You must retrieve it using world instance.
An int can only belong to several groups (0,n) at a time.
Constructors
- GroupManager()
- Creates the GroupManager.
Properties
Methods
-
add(
int entity, String group) → void - Set the group of the entity.
-
added(
int entity) → void -
Called when an
entity
is added to the world.inherited -
deleted(
int entity) → void -
Called when an
entity
is being deleted from the world.override -
destroy(
) → void -
Called when the world gets destroyed. Override if you need to clean up
your manager.
inherited
-
getEntities(
String group) → Iterable< int> - Get all entities that belong to the provided group.
-
getGroups(
int entity) → Iterable< String> ? - Returns the groups the entity belongs to, null if none.
-
initialize(
) → void -
Override to implement code that gets executed when managers are
initialized.
inherited
-
isInAnyGroup(
int entity) → bool - Checks if the entity belongs to any group.
-
isInGroup(
int entity, String group) → bool - Check if the entity is in the supplied group.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
int entity, String group) → void - Remove the entity from the specified group.
-
removeFromAllGroups(
int entity) → void -
Remove
entity
from all existing groups. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited