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('

Module: game/player

Interfaces

Player

Player: Object

The player save data object.

NameTypeDescription
autosavebooleanWhether or not to automatically save every couple of seconds and on tab close.
devSpeednull | numberA multiplier for time passing. Set to 0 when the game is paused.
idstringThe ID of this save.
keepGoingbooleanWhether or not to continue playing after hasWon is true.
layersRecord<string, LayerData<unknown>>A dictionary of layer save data.
modIDstringThe ID of this project, to make sure saves aren't imported into the wrong project.
modVersionstringThe version of the project this save was created by. Used for upgrading saves for new versions.
namestringThe display name of this save.
offlineProdbooleanWhether or not to apply offline time when loading this save.
offlineTimenull | numberHow much offline time has been accumulated and not yet processed.
tabsstring[]The open tabs.
timenumberThe current time this save was last opened at, in ms since the unix epoch.
timePlayednumberHow long, in ms, this game has been played.

Defined in

profectus/src/game/player.ts:5

Type Aliases

LayerData

Ƭ 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.

Type parameters

Name
T

Defined in

profectus/src/game/player.ts:35

Variables

default

default: Object

Type declaration

NameTypeDescription
autosavebooleanWhether or not to automatically save every couple of seconds and on tab close.
devSpeednull | numberA multiplier for time passing. Set to 0 when the game is paused.
idstringThe ID of this save.
keepGoingbooleanWhether or not to continue playing after hasWon is true.
layersRecord<string, LayerData<unknown>>A dictionary of layer save data.
modIDstringThe ID of this project, to make sure saves aren't imported into the wrong project.
modVersionstringThe version of the project this save was created by. Used for upgrading saves for new versions.
namestringThe display name of this save.
offlineProdbooleanWhether or not to apply offline time when loading this save.
offlineTimenull | numberHow much offline time has been accumulated and not yet processed.
tabsstring[]The open tabs.
timenumberThe current time this save was last opened at, in ms since the unix epoch.
timePlayednumberHow long, in ms, this game has been played.

Defined in

profectus/src/game/player.ts:63

Functions

stringifySave

stringifySave(player): string

Convert a player save data object into a JSON string. Unwraps refs.

Parameters
NameType
playerPlayer
Returns

string

Defined in

profectus/src/game/player.ts:66

',33),r=[o];function n(s,i,c,f,h,y){return a(),t("div",null,r)}const u=e(d,[["render",n]]);export{p as __pageData,u as default};