Plasma Engine  2.0
Loading...
Searching...
No Matches
plActorManager Class Referencefinal

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 ()
 
plActorApiServiceGetApiService (const plRTTI *pType)
 
template<typename Type >
Type * GetApiService ()
 

Static Public Attributes

static plCopyOnBroadcastEvent< const plActorEvent & > s_ActorEvents
 

Member Enumeration Documentation

◆ DestructionMode

Specifies whether something should be destroyed right now or delayed during the next Update()

Enumerator
Immediate 

Destruction is executed right now.

Queued 

Destruction is queued and done during the next Update()

Member Function Documentation

◆ AddActor()

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.

◆ DestroyAllActors()

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().


The documentation for this class was generated from the following files: