In-memory save DTO for a GameClock: an identifier, the canonical integer microsecond count, and the derived DateTime. The serializer fills it from the clock's current_microseconds, stores via to_dict(), and restores via from_dict().
Source: addons/calendar_time/game_time/state/time_snapshot.gd
Syntax
class TimeSnapshot extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
serialization_id | Property | Identifier in serialized saves (`Keys.SERIALIZATION_ID`); the literal `"time_state"` is the preserved legacy 1.x dict-key (MIGRATION.md §5). |
calendar | Property | Used only by from_dict() to recompute date_time for legacy game_seconds saves; v3+ saves the DateTime directly. |
date_time | Property | DateTime captured in the save (v3+ serializes it; legacy saves recompute it). |
epoch | Property | Optional save-time epoch. Persisted with the canonical µs so `date_time()` reconstructs the same date; without it a custom epoch reverts on load. |
game_microseconds | Property | Canonical elapsed game time as exact integer microseconds: the persisted source of truth; game_seconds and dates derive from it. |
game_seconds | Property | Float view of `game_microseconds`; writes round to whole microseconds. |
validate | Method | |
from_dict | Method | |
to_dict | Method | |
SCHEMA_VERSION | Field | On-disk key schema version. v2 used "id"; v3 "serialization_id"; v4 adds schema_version and calendar_identity. |
SCHEMA_VERSION_KEY | Field | Schema v4 key for the version number itself. |
SERIALIZATION_ID | Field | Schema v3 key. Written by to_dict(). |
DATE_TIME | Field | Date-time value is serialized under this key. |
GAME_MICROSECONDS | Field | Schema v3 canonical clock: exact integer game-microseconds. |
CALENDAR_IDENTITY | Field | Calendar fingerprint used to interpret elapsed microseconds; mismatch on load warns but does not block loading. |
GAME_TICKS | Field | Legacy key, auto-migrated to GAME_MICROSECONDS (MIGRATION.md §5). |
GAME_SECONDS | Field | Game-seconds value is serialized under this key. |
EPOCH | Field | Epoch key (v3+), written only for non-default epochs. |
LEGACY_ID | Field | Legacy v1/v2 key, auto-migrated to SERIALIZATION_ID (MIGRATION.md §5). |
get_keys | Method |