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.
AgeServiceresolution:clock.age_registry.get_state_or_new(service_id, ...).AgeComponentresolution:clock.age_registryvia the component's@export var clock.
Source: addons/calendar_time/ageing/state/age_state_registry.gd
Syntax
class AgeStateRegistryMembers
| Name | Kind | Summary |
|---|---|---|
AgeSignalBus | Field | Get console prints for registry operation results `AgeSignalBus` is preloaded here to emit registry resolution events. |
AgeStateCoordinator | Field | `AgeStateCoordinator` is preloaded here to supply registry entry definitions. |
debug | Property | When true, the registry logs verbose operation traces to aid debugging. |
signal_bus | Property | Signal bus the registry emits state-resolution events through. |
coordinator | Property | Coordinator that supplies age-state definitions to registry entries. |
main_age_id | Property | Unique 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 |
register | Method | |
detach | Method | |
get_state_or_new | Method | |
get_state | Method | |
get_size | Method | |
get_all | Method | |
has_state | Method | |
remove | Method | |
clear | Method | |
generate_uuid | Method | |
to_dict | Method | |
from_dict | Method |