diff --git a/src/game/player.ts b/src/game/player.ts index 30f9a6c..506337d 100644 --- a/src/game/player.ts +++ b/src/game/player.ts @@ -3,6 +3,7 @@ import Decimal from "util/bignum"; import type { ProxiedWithState } from "util/proxies"; import { ProxyPath, ProxyState } from "util/proxies"; import { reactive, unref } from "vue"; +import type { Ref } from "vue"; import transientState from "./state"; export interface PlayerData { @@ -18,11 +19,23 @@ export interface PlayerData { keepGoing: boolean; modID: string; modVersion: string; - layers: Record>; + layers: Record>; } export type Player = ProxiedWithState; +export type LayerData = { + [P in keyof T]?: T[P] extends (infer U)[] + ? LayerData[] + : T[P] extends Record + ? never + : T[P] extends Ref + ? S + : T[P] extends object + ? LayerData + : T[P]; +}; + const state = reactive({ id: "", devSpeed: null,