Skip to main content

LifecycleConfig Class

Configuration for lifecycle management on a GameObject. More...

Declaration

class helios::engine::builder::gameObject::builders::configs::LifecycleConfig { ... }

Public Constructors Index

LifecycleConfig (helios::engine::ecs::GameObject &gameObject)

Constructs a LifecycleConfig for the given GameObject. More...

Public Member Functions Index

LifecycleConfig &useDelayedComponentEnabler ()

Enables delayed component activation for this entity. More...

Private Member Attributes Index

helios::engine::ecs::GameObject &gameObject_

Non-owning pointer to the target GameObject. More...

Description

Configuration for lifecycle management on a GameObject.

LifecycleConfig provides a fluent interface for setting up delayed component activation. When combined with spawn initializers, this enables powerful patterns like collision immunity windows and staggered wave activation.

## Usage

```cpp LifecycleConfig{gameObject} .useDelayedComponentEnabler(); ```

## Integration with Spawn System

Use with `DelayedComponentEnablerInitializer` to defer specific components during spawn:

```cpp // In prototype setup prototype.withLifecycle([](LifecycleBuilder& builder) { builder.lifecycle().useDelayedComponentEnabler(); });

// In spawn profile spawnProfile.spawnInitializer = std::make_unique<DelayedComponentEnablerInitializer< CollisionComponent>>(0.5f, 25); ```

See Also

DelayedComponentEnabler

See Also

DelayedComponentEnablerSystem

See Also

DelayedComponentEnablerInitializer

Definition at line 54 of file LifecycleConfig.ixx.

Public Constructors

LifecycleConfig()

helios::engine::builder::gameObject::builders::configs::LifecycleConfig::LifecycleConfig (helios::engine::ecs::GameObject & gameObject)
inline explicit

Constructs a LifecycleConfig for the given GameObject.

Parameters
<a href="/docs/helios/namespaces/helios/engine/builder/gameobject">gameObject</a>

Non-owning pointer to the target entity.

Definition at line 69 of file LifecycleConfig.ixx.

Referenced by useDelayedComponentEnabler.

Public Member Functions

useDelayedComponentEnabler()

LifecycleConfig & helios::engine::builder::gameObject::builders::configs::LifecycleConfig::useDelayedComponentEnabler ()
inline

Enables delayed component activation for this entity.

Adds a DelayedComponentEnabler component if not already present. This component maintains a queue of components scheduled for delayed activation, which is processed by the DelayedComponentEnablerSystem.

Returns

Reference to this config for method chaining.

Definition at line 80 of file LifecycleConfig.ixx.

Reference LifecycleConfig.

Private Member Attributes

gameObject_

helios::engine::ecs::GameObject& helios::engine::builder::gameObject::builders::configs::LifecycleConfig::gameObject_

Non-owning pointer to the target GameObject.

Definition at line 60 of file LifecycleConfig.ixx.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.