ClockGroupSerializer — game-level "all my clocks" save/load facade. Owns a ClockGroup and produces / consumes one save dictionary that contains time + age combined per clock (single dict per clock, namespaced under the group's save_key). Drop-in replacement for host.get_calendar_time_serializer().to_dict() for multi-clock games (and for single-clock games that want the namespaced format). Per-clock dict shape (the legacy on-disk key is preserved at the top level for 1.x save migration — see TimeSnapshot): { "clock_id": , "time_state": {serialization_id, ...}, "age_states": {...}, "age_service_state": {...} } Top-level shape (id-keyed): { group.save_key: { : , ... } } Identity is clock_id, not array index (issue #42). Saves written under the index-keyed form (rare, only from very early unreleased 2.0-pre dev builds) are tolerated via a fallback that materialises positional keys ("0", "1", …) for any dict lacking clock_id. Reordering clocks between save and load is safe — saves restore each clock's state into the clock matching the id, regardless of position in host.clocks. New saves always include clock_id. See docs/notes/multi-clock-save-identity.md for the rationale.
Source: addons/calendar_time/game_time/state/clock_group_serializer.gd
Syntax
class ClockGroupSerializer extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
TIME_STATE | Field | |
AGE_STATES | Field | |
AGE_SERVICE_STATE | Field | |
WORLD_AGE_SYSTEM_STATE | Field | |
CLOCK_ID | Field | |
clock_group | Property | The group this serializer aggregates. Must be set before calling to_dict() / from_dict() — fail fast otherwise. |
to_dict | Method | |
nested | Property | |
duplicates | Property | |
first_index_by_id | Property | |
clock | Property | |
id | Property | |
id_str | Property | |
result | Property | |
from_dict | Method | |
nested | Property | |
nested_dict | Property | |
clocks_by_id | Property | |
first_index_by_id | Property | |
c | Property | |
c_id_str | Property | |
positional_index | Property | |
entry | Property | |
resolved_clock | Property | |
saved_id | Property | |
candidate | Property | |
dict | Property | |
age_serializer | Property | |
age_serializer | Property | |
entry | Property |
Source
addons/calendar_time/game_time/state/clock_group_serializer.gd
Plugin docs root:gdscript/plugins/calendar_time_dev/docs