Skip to content
ct

Class

AgeStateRegistry

Generated GDScript class reference for CalendarTime.AgeStateRegistry.

Status
Current
Version
v2.0.4
Updated
2026-08-09

Used to register the IDs and Resource references for AgeStates in a per-clock scope, with support for serialization and potential multiplayer. There is no process-wide singleton. Each GameClock constructs and owns its own AgeStateRegistry (see GameClock.age_registry); every AgeService and AgeComponent bound to that clock reads/writes here. Two clocks running side-by-side never see each other's age states. Per-clock ownership means:

  • Clock lifetime owns registry lifetime (no orphan registries).
  • Tests get hermetic isolation between clocks (no shared state, no need to registry.clear() between unrelated tests).
  • Two game instances in one process each carry their own registry.
  • AgeService resolution: clock.age_registry.get_state_or_new(service_id, ...).
  • AgeComponent resolution: clock.age_registry via the component's @export var clock.

Source: addons/calendar_time/ageing/state/age_state_registry.gd

Syntax

class AgeStateRegistry

Members

NameKindSummary
AgeSignalBusFieldGet console prints for registry operation results `AgeSignalBus` is preloaded here to emit registry resolution events.
AgeStateCoordinatorField`AgeStateCoordinator` is preloaded here to supply registry entry definitions.
debugPropertyWhen true, the registry logs verbose operation traces to aid debugging.
signal_busPropertySignal bus the registry emits state-resolution events through.
coordinatorPropertyCoordinator that supplies age-state definitions to registry entries.
main_age_idPropertyUnique main ID. Should be set before other age states to serve as the default parent Objects occupy the world therefore AgeStates are children of the world's AgeState
registerMethod
detachMethod
get_state_or_newMethod
get_stateMethod
get_sizeMethod
get_allMethod
has_stateMethod
removeMethod
clearMethod
generate_uuidMethod
to_dictMethod
from_dictMethod