Module: game/player
Interfaces
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:43
Player
Ƭ Player: ProxiedWithState
<PlayerData
>
The proxied player that is used to track NaN values.
Defined in
profectus/src/game/player.ts:40
Variables
default
• default: { autosave
: boolean
; devSpeed
: null
| number
; id
: string
; keepGoing
: boolean
; layers
: { [x: string]: {} & { [ProxyState]: LayerData<unknown>; [ProxyPath]: string[]; }; } & { [ProxyPath]
: string
[] ; [ProxyState]
: Record
<string
, LayerData
<unknown
>> } ; modID
: string
; modVersion
: string
; name
: string
; offlineProd
: boolean
; offlineTime
: null
| number
; tabs
: string
[] & { [ProxyPath]
: string
[] ; [ProxyState]
: string
[] } ; time
: number
; timePlayed
: number
} & { [ProxyPath]
: string
[] ; [ProxyState]
: PlayerData
}
The player save data object.
Defined in
profectus/src/game/player.ts:154
Functions
stringifySave
▸ stringifySave(player
): string
Convert a player save data object into a JSON string. Unwraps refs.
Parameters
Name | Type |
---|---|
player | PlayerData |
Returns
string