public abstract class BaseEntitySystem extends BaseSystem implements EntitySubscription.SubscriptionListener
Modifier and Type | Field and Description |
---|---|
protected EntitySubscription |
subscription |
world
Constructor and Description |
---|
BaseEntitySystem(Aspect.Builder aspect)
Creates an entity system that uses the specified aspect as a matcher
against entities.
|
Modifier and Type | Method and Description |
---|---|
IntBag |
getEntityIds()
Gets the entities processed by this system.
|
EntitySubscription |
getSubscription() |
protected void |
inserted(int entityId)
Called if entity has come into scope for this system, e.g
created or a component was added to it.
|
void |
inserted(IntBag entities)
Called after entities have been matched and inserted into an
EntitySubscription.
|
protected void |
removed(int entityId)
Called if entity has gone out of scope of this system, e.g deleted
or had one of it's components removed.
|
void |
removed(IntBag entities)
Called after entities have been removed from an EntitySubscription.
|
protected void |
setWorld(World world)
Set the world this system works on.
|
begin, checkProcessing, dispose, end, getWorld, initialize, isEnabled, process, processSystem, setEnabled
protected EntitySubscription subscription
public BaseEntitySystem(Aspect.Builder aspect)
aspect
- to match against entitiesprotected void setWorld(World world)
BaseSystem
setWorld
in class BaseSystem
world
- the world to setpublic EntitySubscription getSubscription()
public void inserted(IntBag entities)
EntitySubscription.SubscriptionListener
inserted
in interface EntitySubscription.SubscriptionListener
public IntBag getEntityIds()
protected void inserted(int entityId)
entityId
- the entity that was added to this systempublic void removed(IntBag entities)
EntitySubscription.SubscriptionListener
Called after entities have been removed from an EntitySubscription.
Explicitly removed components are only retrievable at this point
if annotated with DelayedComponentRemoval
.
Deleted entities retain all their components until - all listeners have been informed.
removed
in interface EntitySubscription.SubscriptionListener
protected void removed(int entityId)
Called if entity has gone out of scope of this system, e.g deleted or had one of it's components removed.
Explicitly removed components are only retrievable at this point
if annotated with DelayedComponentRemoval
.
Deleted entities retain all their components - until all listeners have been informed.
entityId
- the entity that was removed from this systemCopyright © 2016. All rights reserved.