struct IEntitySystemSink { };
IEntitySystem.h
A callback interface for a class that wants to be aware when new entities are being spawned or removed. A class that implements this interface will be called every time a new entity is spawned, removed, or when an entity container is to be spawned.
virtual ~IEntitySystemSink();
virtual void GetMemoryUsage(class ICrySizer * pSizer) const;
Parameters |
Description |
class ICrySizer * pSizer |
The Sizer class used to collect the memory informations |
Collect memory informations
virtual bool OnBeforeSpawn(SEntitySpawnParams & params) = 0;
Parameters |
Description |
SEntitySpawnParams & params |
The parameters that will be used to spawn the entity. |
This callback is called before this entity is spawned. The entity will be created and added to the list of entities, if this function returns true. Returning false will abort the spawning process.
virtual void OnEvent(IEntity * pEntity, SEntityEvent & event) = 0;
Parameters |
Description |
IEntity * pEntity |
The entity that is being removed. This entity is still fully valid. event - |
Called in response to an entity event.
virtual bool OnRemove(IEntity * pEntity) = 0;
Parameters |
Description |
IEntity * pEntity |
The entity that is being removed. This entity is still fully valid. |
True to allow removal, false to deny.
Called when an entity is being removed.
virtual void OnReused(IEntity * pEntity, SEntitySpawnParams & params) = 0;
Parameters |
Description |
IEntity * pEntity |
The entity that is being reused. This entity is still fully valid and with its new EntityId. |
SEntitySpawnParams & params |
The new params this entity is using. |
Called when an entity has been reused. You should clean up when this is called.
virtual void OnSpawn(IEntity * pEntity, SEntitySpawnParams & params) = 0;
Parameters |
Description |
IEntity * pEntity |
The entity that was just spawned params - |
This callback is called when this entity has finished spawning. The entity has been created and added to the list of entities, but has not been initialized yet.