defineSave
defineSave<
Schema,Scope>(config): [Schema] extends [never] ?IncludeSaveDeclaration:GameStateSaveDeclaration<Schema,Scope>
Declares a game’s own save, once, in src/save.ts: the engine saves it
wants, and one schema, read and restore for its own state, or none
of them where it keeps only what include names. Throws for some of
the game’s own fields without the rest,
for a version that is no whole number from 1, a step missing between 2
and the version, an include name the engine has no save for,
and resources without stats. A game sets no interval: the platform
writes the save on its own schedule.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
Schema extends SaveSchema |
never |
Scope extends "entity" | "world" | "player" |
"player" |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
config |
SaveConfig<Schema, Scope> |
Returns
Section titled “Returns”[Schema] extends [never] ? IncludeSaveDeclaration : GameStateSaveDeclaration<Schema, Scope>