/** * One independently saved slice of player progress. * * ARCHITECTURE.md asks for a save built from several classes, each handling its * own part, keyed by the class. The key here is an explicit string rather than * `constructor.name` on purpose: release builds minify class names, and a * renamed class would silently orphan every existing save. */ export interface ISaveSection { /** Stable identifier. Never change it once a build has shipped. */ readonly key: string; /** Current contents as a JSON-safe value. */ save(): unknown; /** * Restores from a previously saved value. Must tolerate anything — an older * shape, a newer shape, or outright rubbish — by falling back to defaults * rather than throwing. */ load(data: unknown): void; /** Returns to the state of a player who has never played. */ reset(): void; }