public static interface EntitySubscription.SubscriptionListener
This interfaces reports entities inserted or
removed when matched against their EntitySubscription
Modifier and Type | Method and Description |
---|---|
void |
inserted(IntBag entities)
Called after entities match an
EntitySubscription . |
void |
removed(IntBag entities)
Called after entities no longer match an EntitySubscription.
|
void inserted(IntBag entities)
EntitySubscription
.
Triggers right after a system finishes processing. Adding and immediately removing a component does not
permanently change the composition and will prevent this method from being called.
Not triggered for entities that have been destroyed immediately after being created (within a system).void removed(IntBag entities)
Called after entities no longer match an EntitySubscription.
Triggers right after a system finishes processing. Replacing a component with another of the same type within a system does not count as a composition change and will prevent this method from being called. Can trigger for entities that have been destroyed immediately after being created (within a system).
Important note on accessing components:
Using ComponentMapper.get(int)
to retrieve a component is unsafe, unless:
- You annotate the component with DelayedComponentRemoval
.
- World.isAlwaysDelayComponentRemoval()
is enabled to make accessing all components safe,
for a small performance hit.
ComponentMapper.has(int)
always returns false
, even for DelayedComponentRemoval components.
Copyright © 2019. All rights reserved.