Skip to main content

LifecycleConfig.ixx File

Configuration class for lifecycle and delayed component activation. More...

Included Headers

Namespaces Index

namespacehelios
namespaceengine

Main engine module aggregating core infrastructure and game systems. More...

namespacebuilder

Fluent builder pattern for constructing GameObjects. More...

namespacegameObject

Factory and prototype classes for GameObject construction. More...

namespacebuilders

Domain-specific builders for configuring different aspects of GameObjects. More...

namespaceconfigs

Fine-grained configuration classes for component setup. More...

Classes Index

classLifecycleConfig

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

Description

Configuration class for lifecycle and delayed component activation.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file LifecycleConfig.ixx
3 * @brief Configuration class for lifecycle and delayed component activation.
4 */
5module;
6
7#include <cassert>
8#include <memory>
9
10export module helios.engine.builder.gameObject.builders.configs.LifecycleConfig;
11
12import helios.engine.ecs.GameObject;
13
14import helios.engine.mechanics.lifecycle.components.DelayedComponentEnabler;
15
16
18
19 /**
20 * @brief Configuration for lifecycle management on a GameObject.
21 *
22 * @details LifecycleConfig provides a fluent interface for setting up
23 * delayed component activation. When combined with spawn initializers,
24 * this enables powerful patterns like collision immunity windows and
25 * staggered wave activation.
26 *
27 * ## Usage
28 *
29 * ```cpp
30 * LifecycleConfig{gameObject}
31 * .useDelayedComponentEnabler();
32 * ```
33 *
34 * ## Integration with Spawn System
35 *
36 * Use with `DelayedComponentEnablerInitializer` to defer specific
37 * components during spawn:
38 *
39 * ```cpp
40 * // In prototype setup
41 * prototype.withLifecycle([](LifecycleBuilder& builder) {
42 * builder.lifecycle().useDelayedComponentEnabler();
43 * });
44 *
45 * // In spawn profile
46 * spawnProfile.spawnInitializer = std::make_unique<DelayedComponentEnablerInitializer<
47 * CollisionComponent>>(0.5f, 25);
48 * ```
49 *
50 * @see DelayedComponentEnabler
51 * @see DelayedComponentEnablerSystem
52 * @see DelayedComponentEnablerInitializer
53 */
55
56
57 /**
58 * @brief Non-owning pointer to the target GameObject.
59 */
61
62 public:
63
64 /**
65 * @brief Constructs a LifecycleConfig for the given GameObject.
66 *
67 * @param gameObject Non-owning pointer to the target entity.
68 */
70
71 /**
72 * @brief Enables delayed component activation for this entity.
73 *
74 * @details Adds a DelayedComponentEnabler component if not already present.
75 * This component maintains a queue of components scheduled for delayed
76 * activation, which is processed by the DelayedComponentEnablerSystem.
77 *
78 * @return Reference to this config for method chaining.
79 */
81
83
84 return *this;
85 }
86
87
88
89 };
90
91}
92

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.