![]() |
Plasma Engine
2.0
|
Public Types | |
enum class | DestructionMode { Immediate , Queued } |
Specifies whether something should be destroyed right now or delayed during the next Update() More... | |
Public Member Functions | |
void | Update () |
Updates all Actors and ActorApiServices, deletes actors that are queued for destruction. | |
void | Shutdown () |
Destroys all Actors and ActorApiServices. | |
void | AddActor (plUniquePtr< plActor > &&pActor) |
Gives control over the actor to the plActorManager. | |
void | DestroyActor (plActor *pActor, DestructionMode mode=DestructionMode::Immediate) |
Destroys the given actor. If mode is DestructionMode::Queued the destruction will be delayed until the end of the next Update(). | |
void | DestroyAllActors (const void *pCreatedBy, DestructionMode mode=DestructionMode::Immediate) |
Destroys all actors which have been created by the pCreatedBy object. | |
void | GetAllActors (plHybridArray< plActor *, 8 > &out_allActors) |
Returns all actors currently in the system, including ones that are queued for destruction. | |
void | DestroyQueuedActors () |
Destroys all actors that are queued for destruction. This is already executed by Update(), calling it directly only makes sense if one needs to clean up actors without also updating the others. | |
void | AddApiService (plUniquePtr< plActorApiService > &&pService) |
void | DestroyApiService (plActorApiService *pService, DestructionMode mode=DestructionMode::Immediate) |
void | DestroyAllApiServices (DestructionMode mode=DestructionMode::Immediate) |
void | DestroyQueuedActorApiServices () |
plActorApiService * | GetApiService (const plRTTI *pType) |
template<typename Type > | |
Type * | GetApiService () |
Static Public Attributes | |
static plCopyOnBroadcastEvent< const plActorEvent & > | s_ActorEvents |
|
strong |
void plActorManager::AddActor | ( | plUniquePtr< plActor > && | pActor | ) |
Gives control over the actor to the plActorManager.
From now on the actor will be updated every frame and the lifetime will be managed by the plActorManager.
void plActorManager::DestroyAllActors | ( | const void * | pCreatedBy, |
DestructionMode | mode = DestructionMode::Immediate ) |
Destroys all actors which have been created by the pCreatedBy object.
If pCreatedBy == nullptr, all actors are destroyed. If mode is DestructionMode::Queued the destruction will be delayed until the end of the next Update().