Skip to main content

PrefabIdComponent.ixx File

Component that stores the prefab identity of a pooled GameObject. More...

Included Headers

Namespaces Index

namespacehelios
namespaceengine

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

namespaceruntime

Runtime infrastructure for game execution and lifecycle orchestration. More...

namespacepooling

GameObject pooling for efficient object recycling. More...

namespacecomponents

Classes Index

classPrefabIdComponent

Component that stores the PrefabId identifying a GameObject's prefab origin. More...

Description

Component that stores the prefab identity of a pooled GameObject.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file PrefabIdComponent.ixx
3 * @brief Component that stores the prefab identity of a pooled GameObject.
4 */
5module;
6
7export module helios.engine.runtime.pooling.components.PrefabIdComponent;
8
9
10import helios.engine.common.types.PrefabId;
11import helios.core.types;
12
14
16
17 /**
18 * @brief Component that stores the PrefabId identifying a GameObject's prefab origin.
19 *
20 * @details PrefabIdComponent is attached to pooled GameObjects to record which
21 * prefab template they were cloned from. The pool system uses this ID to
22 * associate entities with their originating pool configuration.
23 *
24 * Copy construction and assignment are explicitly deleted because prefab
25 * identity is intrinsic to the original template - cloned instances receive
26 * their own PrefabIdComponent via move during pool initialization, not
27 * through the blueprint copy path.
28 *
29 * @see PrefabId
30 * @see GameObjectPoolConfig
31 * @see GameObjectFactory::withPrefabId
32 */
34
35 /**
36 * @brief The prefab identifier for this entity's template origin.
37 */
38 PrefabId prefabId_;
39
40 public:
41
42 /**
43 * @brief Destructor.
44 */
45 ~PrefabIdComponent() = default;
46
47 /// @brief Copy construction is deleted (prefab identity is not cloneable).
49
50 /// @brief Copy assignment is deleted (prefab identity is not cloneable).
52
53 /// @brief Move constructor.
55
56 /// @brief Move assignment operator.
58
59 /**
60 * @brief Constructs a PrefabIdComponent with the given prefab identifier.
61 *
62 * @param prefabId The prefab identifier to store.
63 */
64 explicit PrefabIdComponent(const PrefabId prefabId) : prefabId_(prefabId) {}
65
66 /**
67 * @brief Returns the stored prefab identifier.
68 *
69 * @return The PrefabId identifying the prefab template.
70 */
71 [[nodiscard]] PrefabId prefabId() const noexcept {
72 return prefabId_;
73 }
74
75
76 };
77
78}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.