Base class for all components (data-only).
More...
#include <DekiComponent.h>
Inherited by CoreProjectSettings, DekiBehaviour, DisplayProjectSettings, MissingComponent, and UnitProjectSettings.
Base class for all components (data-only).
DekiComponent provides:
- Runtime type identification via GetType()/GetBaseType()
- Owner reference for accessing the parent DekiObject
For components that need lifecycle methods (PreRender, Start, Update), inherit from DekiBehaviour instead.
◆ DekiComponent() [1/2]
| DekiComponent::DekiComponent |
( |
| ) |
|
|
inline |
◆ ~DekiComponent()
| virtual DekiComponent::~DekiComponent |
( |
| ) |
|
|
virtualdefault |
◆ DekiComponent() [2/2]
◆ operator=()
◆ GetType()
◆ GetBaseType()
◆ AsBehaviour()
◆ DeclaresUpdate()
| virtual bool DekiComponent::DeclaresUpdate |
( |
| ) |
const |
|
inlinevirtual |
Does this class (or a reflected base) declare Update()?
Generated by the reflection codegen for every DEKI_COMPONENT: true when the class itself declares an Update member, otherwise whatever the reflected base answers. LifecycleManager only calls Update() on behaviours that answer true, so a behaviour with no Update costs nothing per frame. Hand-written components outside the codegen (tests) override it themselves.
◆ GetOwner()
◆ SetOwner()
| void DekiComponent::SetOwner |
( |
DekiObject * | owner | ) |
|
|
inline |
◆ LoadAssets()
| virtual void DekiComponent::LoadAssets |
( |
| ) |
|
|
inlinevirtual |
Load assets needed by this component.
Components override this to load their assets (sprites, fonts, etc.) Called by Play Mode during initialization. Use Deki::AssetManager::Get() to access the asset manager.
◆ UnloadAssets()
| virtual void DekiComponent::UnloadAssets |
( |
| ) |
|
|
inlinevirtual |
Unload/clear assets held by this component.
Components override this to clear asset pointers before shutdown. The asset manager owns the memory, so just set pointers to nullptr.
◆ RuntimeUpdate()
| virtual void DekiComponent::RuntimeUpdate |
( |
float | deltaTime | ) |
|
|
inlinevirtual |
Update this component (runtime only).
- Parameters
-
| deltaTime | Time since last frame in seconds |
Components that need per-frame updates (physics, animation, etc.) override this. Different from DekiBehaviour::Update() which is for scripts.
◆ OnAssetRefResolved()
| virtual void DekiComponent::OnAssetRefResolved |
( |
const char * | propertyName, |
|
|
void * | asset, |
|
|
const char * | guid ) |
|
inlinevirtual |
Called after an AssetRef property is resolved by LifecycleManager.
- Parameters
-
| propertyName | Name of the property that was resolved |
| asset | Pointer to the loaded asset |
| guid | The GUID that was used to load the asset |
Components can override this to perform post-load processing — e.g. inspecting whether the GUID resolves to a sub-asset and deriving extra runtime state from it.
◆ NeedsAssetLoading()
| virtual bool DekiComponent::NeedsAssetLoading |
( |
| ) |
const |
|
inlinevirtual |
Check if this component needs asset loading.
- Returns
- true if LoadAssets() should be called
◆ NeedsRuntimeUpdate()
| virtual bool DekiComponent::NeedsRuntimeUpdate |
( |
| ) |
const |
|
inlinevirtual |
Check if this component needs runtime updates.
- Returns
- true if RuntimeUpdate() should be called each frame
◆ Deserialize()
Deserialize component data from MessagePack.
- Parameters
-
| parser | The msgpack parser positioned at component data map |
| mapSize | Number of key-value pairs in the data map |
- Returns
- true if deserialization succeeded
Generated by the reflection codegen for each component. Uses hash-switch on property names for performance.
◆ ResolveObjectRefs()
| virtual void DekiComponent::ResolveObjectRefs |
( |
class Scene * | scene | ) |
|
|
inlinevirtual |
Resolve all ObjectRef properties in this component.
- Parameters
-
| scene | The scene to look up objects in |
Generated by the reflection codegen for components with ObjectRef properties. Called by LifecycleManager before Awake() to resolve ObjectRef.id → ObjectRef.resolved. Zero-overhead: direct field access, no metadata iteration.
◆ RemapObjectRefs()
| virtual void DekiComponent::RemapObjectRefs |
( |
const std::unordered_map< uint32_t, uint32_t > & | idRemap | ) |
|
|
inlinevirtual |
Remap ObjectRef IDs after cloning/instantiation.
- Parameters
-
| idRemap | Map of old object ID → new object ID |
Generated by the reflection codegen for components with ObjectRef properties. Called after Instantiate() to update ObjectRef.id fields to new unique IDs.
◆ HasRefsResolved()
| bool DekiComponent::HasRefsResolved |
( |
| ) |
const |
|
inline |
◆ MarkRefsResolved()
| void DekiComponent::MarkRefsResolved |
( |
| ) |
|
|
inline |
◆ ResetRefsResolved()
| void DekiComponent::ResetRefsResolved |
( |
| ) |
|
|
inline |
◆ OnPropertyChanged()
| virtual void DekiComponent::OnPropertyChanged |
( |
const char * | propertyName | ) |
|
|
inlinevirtual |
Called when a property is modified via the editor.
- Parameters
-
| propertyName | Name of the property that changed |
Components can override this to react to property changes. Called after Execute() and Undo() in ModifyComponentPropertyCommand.
◆ StaticType
◆ m_Owner
◆ m_RefsResolved
| bool DekiComponent::m_RefsResolved |
|
protected |
The documentation for this class was generated from the following file: