import{_ as e,c as t,o as a,N as l}from"./chunks/framework.0799945b.js";const p=JSON.parse('{"title":"Module: game/player","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/game/player.md","lastUpdated":null}'),d={name:"api/modules/game/player.md"},o=l('
• Player: Object
The player save data object.
Name | Type | Description |
---|---|---|
autosave | boolean | Whether or not to automatically save every couple of seconds and on tab close. |
devSpeed | null | number | A multiplier for time passing. Set to 0 when the game is paused. |
id | string | The ID of this save. |
keepGoing | boolean | Whether or not to continue playing after hasWon is true. |
layers | Record <string , LayerData <unknown >> | A dictionary of layer save data. |
modID | string | The ID of this project, to make sure saves aren't imported into the wrong project. |
modVersion | string | The version of the project this save was created by. Used for upgrading saves for new versions. |
name | string | The display name of this save. |
offlineProd | boolean | Whether or not to apply offline time when loading this save. |
offlineTime | null | number | How much offline time has been accumulated and not yet processed. |
tabs | string [] | The open tabs. |
time | number | The current time this save was last opened at, in ms since the unix epoch. |
timePlayed | number | How long, in ms, this game has been played. |
profectus/src/game/player.ts:5
Ƭ LayerData<T
>: { [P in keyof T]?: T[P] extends (infer U)[] ? Record<string, LayerData<U>> : T[P] extends Record<string, never> ? never : T[P] extends Ref<infer S> ? S : T[P] extends object ? LayerData<T[P]> : T[P] }
A layer's save data. Automatically unwraps refs.
Name |
---|
T |
profectus/src/game/player.ts:35
• default: Object
Name | Type | Description |
---|---|---|
autosave | boolean | Whether or not to automatically save every couple of seconds and on tab close. |
devSpeed | null | number | A multiplier for time passing. Set to 0 when the game is paused. |
id | string | The ID of this save. |
keepGoing | boolean | Whether or not to continue playing after hasWon is true. |
layers | Record <string , LayerData <unknown >> | A dictionary of layer save data. |
modID | string | The ID of this project, to make sure saves aren't imported into the wrong project. |
modVersion | string | The version of the project this save was created by. Used for upgrading saves for new versions. |
name | string | The display name of this save. |
offlineProd | boolean | Whether or not to apply offline time when loading this save. |
offlineTime | null | number | How much offline time has been accumulated and not yet processed. |
tabs | string [] | The open tabs. |
time | number | The current time this save was last opened at, in ms since the unix epoch. |
timePlayed | number | How long, in ms, this game has been played. |
profectus/src/game/player.ts:63
▸ stringifySave(player
): string
Convert a player save data object into a JSON string. Unwraps refs.
Name | Type |
---|---|
player | Player |
string