Skip to content

EntityComponentRegistry ​

Inherits: RefCounted

Unified component manager for Entity - combines registry and factory Provides type-safe access to all entity components with lazy initialization Eliminates timing issues by ensuring components exist when accessed

Methods ​

voidsetup( system_hub: GameHost.SystemHub, owner_entity: Entity )
Variantget_component( type: ComponentType )
boolhas_component( type: ComponentType )
voidcreate_mediator( system_hub: GameHost.SystemHub, owner_entity: Entity )
StatsComponentstats()
EffectsComponenteffects()
AbilityComponentabilities()
EquipmentInventoryComponentequipment()
InventoryComponentinventory()
AudioComponentaudio()
EntityRigComponentrig()
EntityAnimationPlayeranimation()
EntityStateComponentstates()
PetManagerComponentpets()
EntityComponentMediatormediator()
Nameplatenameplate()
voidset_nameplate( value: Nameplate )
Marker3Dnameplate_marker()
voidcleanup()

Enumerations ​

enum ComponentType ​

The options of component type: stats, effects, abilities, equipment, inventory, audio, rig, animation, states, pets ....

  • STATS = 0
  • EFFECTS = 1
  • ABILITIES = 2
  • EQUIPMENT = 3
  • INVENTORY = 4
  • AUDIO = 5
  • RIG = 6
  • ANIMATION = 7
  • STATES = 8
  • PETS = 9
  • MEDIATOR = 10

Method descriptions ​

void setup( system_hub: GameHost.SystemHub, owner_entity: Entity ) ​

Initialize manager with entity reference

Variant get_component( type: ComponentType ) ​

Get a component by type with safety check

bool has_component( type: ComponentType ) ​

Check if component exists

void create_mediator( system_hub: GameHost.SystemHub, owner_entity: Entity ) ​

Makes the mediator that connects the components of the entity.

StatsComponent stats() ​

Get stats component (convenience)

EffectsComponent effects() ​

Get effects component (convenience)

AbilityComponent abilities() ​

Get abilities component (convenience)

EquipmentInventoryComponent equipment() ​

Get equipment component (convenience)

InventoryComponent inventory() ​

Get inventory component (convenience)

AudioComponent audio() ​

Get audio component (convenience)

EntityRigComponent rig() ​

Get rig component (convenience)

EntityAnimationPlayer animation() ​

Get animation component (convenience)

EntityStateComponent states() ​

Get states component (convenience)

PetManagerComponent pets() ​

Get pets container (convenience)

EntityComponentMediator mediator() ​

Get mediator (convenience)

Nameplate nameplate() ​

Get nameplate reference (assigned by external HUD system)

void set_nameplate( value: Nameplate ) ​

Set nameplate reference (called by external HUD system)

Marker3D nameplate_marker() ​

Get nameplate positioning marker

void cleanup() ​

Cleanup all components