![]() |
Plasma Engine
2.0
|
Certain components may delete themselves or their owner when they are finished with their main purpose. More...
#include <Declarations.h>
Public Types | |
enum | Enum : StorageType { None , DeleteComponent , DeleteGameObject , Default = None } |
using | StorageType = plUInt8 |
Static Public Member Functions | |
static void | HandleFinishedAction (plComponent *pComponent, plOnComponentFinishedAction::Enum action) |
Call this when a component is 'finished' with its work. | |
static void | HandleDeleteObjectMsg (plMsgDeleteGameObject &ref_msg, plEnum< plOnComponentFinishedAction > &ref_action) |
Call this function in a message handler for plMsgDeleteGameObject messages. | |
Certain components may delete themselves or their owner when they are finished with their main purpose.
enum plOnComponentFinishedAction::Enum : StorageType |
|
static |
Call this function in a message handler for plMsgDeleteGameObject messages.
This is needed to coordinate object deletion across multiple components that use the plOnComponentFinishedAction mechanism. Depending on the state of this component, the function will either execute the object deletion, or delay it, until its own work is done.
|
static |
Call this when a component is 'finished' with its work.
Pass in the desired action (usually configured by the user) and the 'this' pointer of the component. The helper function will delete this component and maybe also attempt to delete the entire object. For that it will coordinate with other components, and delay the object deletion, if necessary, until the last component has finished it's work.