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AAa,CAAC,CAAC;SACnD;QACD,OAAO,eAAe,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IAChD,CAAC;IAjBe,yBAAc,iBAiB7B,CAAA;AACL,CAAC,EArUgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAqU1B;AAED,IAAI,uBAAU,CAAC,KAAK,EAAE;IACjB,MAAc,CAAC,UAAU,GAAG,UAAU,CAAC;CAC3C","file":"","sourceRoot":"/","sourcesContent":["import { defaultGlobalVariables, RecordVariableType, defaultRecordVariables, globalVariableConstrains, recordVariableConstrains } from \"./GameVariables\";\nimport { Emitter } from \"simba-eventkit\";\nimport { DeepReadonly, DeepReadonlyArray, throttle } from \"simba-utils\";\nimport { LocalStorage } from \"simba-localstorage\";\nimport { GameConfig } from \"../../GameConfig\";\nimport { getPlotsIndex } from \"./PlotsData\";\nimport { SDK } from \"simba-sdk\";\nimport { SpecialPlotId } from \"../model/PlotModel\";\n\nexport namespace GameRecord {\n let emitter = new Emitter;\n\n const _globalVariables = { ...defaultGlobalVariables };\n const _recordVariables = { ...defaultRecordVariables };\n let _recordVersion: number = 0;\n let _initailized = false;\n\n let _inTransaction = false;\n\n export function startTransaction() {\n _inTransaction = true;\n }\n\n export function endTransaction(forceSave = false) {\n _inTransaction = false;\n forceSave ? saveRecord() : autoSave();\n }\n\n let globalVarDirty = false;\n export const globalVariables = new Proxy(_globalVariables, {\n set: (target, p: string, value) => {\n let constrains = globalVariableConstrains[p];\n if (constrains) {\n if (constrains.min !== undefined && value < constrains.min) {\n value = constrains.min;\n }\n if (constrains.max !== undefined && value > constrains.max) {\n value = constrains.max;\n }\n }\n if (target[p] !== value) {\n globalVarDirty = true;\n let prevValue = target[p];\n target[p] = value;\n emitter.emit(\"g.\" + p, \"global\", p, prevValue, value);\n }\n return true;\n }\n });\n\n export const recordVariables = new Proxy(_recordVariables, {\n set: (target, p: string, value) => {\n let constrains = recordVariableConstrains[p];\n if (constrains) {\n if (constrains.min !== undefined && value < constrains.min) {\n value = constrains.min;\n }\n if (constrains.max !== undefined && value > constrains.max) {\n value = constrains.max;\n }\n }\n if (target[p] !== value) {\n let prevValue = target[p];\n target[p] = value;\n emitter.emit(\"r.\" + p, \"record\", p, prevValue, value);\n }\n return true;\n }\n });\n\n export function getVariableValue(varName: string) {\n if (/^g\\./.test(varName)) {\n return _globalVariables[varName.substr(2)];\n } else if (/^r\\./.test(varName)) {\n return _recordVariables[varName.substr(2)];\n }\n throw new Error(\"Invalid varName.\");\n }\n\n export function setVariableValue(varName: string, value: string | number) {\n if (/^g\\./.test(varName)) {\n globalVariables[varName.substr(2)] = value;\n } else if (/^r\\./.test(varName)) {\n recordVariables[varName.substr(2)] = value;\n } else {\n throw new Error(\"Invalid varName.\");\n }\n }\n\n export function onGlobalVariableChange(varName: string,\n callback: (scope: \"global\", varName: string, prevValue: string | number, value: string | number) => void) {\n return emitter.on(\"g.\" + varName, callback);\n }\n\n export function onRecordVariableChange(varName: string,\n callback: (scope: \"record\", varName: string, prevValue: string | number, value: string | number) => void) {\n return emitter.on(\"r.\" + varName, callback);\n }\n\n export function onVariableChange(varName: string,\n callback: (scope: \"record\" | \"record\", varName: string, prevValue: string | number, value: string | number) => void) {\n if (!/^g\\./.test(varName) && !/^r\\./.test(varName)) {\n throw new Error(\"Invalid varName.\");\n }\n return emitter.on(varName, callback);\n }\n\n interface RecordItem {\n p: number[]; // plotId\n v: Partial<RecordVariableType>; // variables diff\n s?: number[]; // selected option\n c?: object[]; // plot custom data\n }\n\n const plotsInfo: { [key: string]: { cnt: number } } = {};\n const records: { name: string, d: RecordItem[] }[] = [];\n let lastRecordVariables: RecordVariableType;\n let currentRecordIndex: number = -1;\n\n export function getPlotsInfo(): DeepReadonly<typeof plotsInfo> {\n return plotsInfo;\n }\n\n export function getRecords(): DeepReadonly<typeof records> {\n return records;\n }\n\n export function getCurrentRecordItems(): DeepReadonlyArray<RecordItem> {\n return records[currentRecordIndex].d;\n }\n\n export function initRecords() {\n if (_initailized) return;\n _initailized = true;\n Object.assign(_globalVariables, LocalStorage.getObject(GameConfig.gameId + \".gameGlobalVars\", defaultGlobalVariables));\n Object.assign(records, LocalStorage.getObject(GameConfig.gameId + \".gameRecords\", []));\n Object.assign(plotsInfo, LocalStorage.getObject(GameConfig.gameId + \".plotsInfo\", {}));\n _recordVersion = LocalStorage.getInt(GameConfig.gameId + \".recordVersion\");\n\n let data = SDK.getGameRecord();\n let version = data[\"v\"];\n if (version > _recordVersion) {\n overwriteRecordWithData(data, false);\n }\n }\n\n export function setSelectOptionForPlot(plotId: number, option: number) {\n let history = records[currentRecordIndex].d;\n let top = history[history.length - 1];\n let idx = top.p.findIndex(v => v === plotId);\n if (idx >= 0) {\n if (!top.s) top.s = [];\n top.s[idx] = option;\n return;\n }\n throw new Error(\"Invalid option\");\n }\n\n // use PlotManager.completePlto, unless you know what you are doing.\n export function setPlotCustomData(index: number, data: object) {\n let items = records[currentRecordIndex].d;\n let lastItem = items[items.length - 1];\n if (!lastItem.c) lastItem.c = [];\n lastItem.c[index] = data;\n saveRecord();\n }\n\n let _started = false;\n export function startGameWithRecord(index: number) {\n if (_started) {\n for (let k in _recordVariables) {\n delete _recordVariables[k];\n }\n }\n _started = true;\n currentRecordIndex = index;\n if (!records[index]) {\n records[index] = { name: \"\", d: [] };\n }\n const arr = records[index].d;\n Object.assign(_recordVariables, defaultRecordVariables);\n for (let v of arr) {\n Object.assign(_recordVariables, v.v);\n }\n lastRecordVariables = { ..._recordVariables };\n if (!arr.length) {\n arr.push({ p: [getPlotsIndex().firstPlot], v: {} });\n\n }\n return arr[arr.length - 1].p;\n }\n\n export function startPlot(plot: number, index = 0) {\n if (plot >= 0) {\n if (!plotsInfo[plot]) plotsInfo[plot] = { cnt: 1 };\n else plotsInfo[plot].cnt++;\n }\n let history = records[currentRecordIndex].d;\n let p: number[] = [];\n if (history.length) {\n p = [...history[history.length - 1].p];\n }\n p[index] = plot;\n if (plot === SpecialPlotId.End && p.length > 1 && (index === p.length - 1)) { // 支线结束时,判断能否缩短数组\n let i = p.length - 2;\n let deleteCount = 1;\n for (; i > 0; i--) {\n if (p[i] !== SpecialPlotId.End) {\n break;\n } else {\n deleteCount++;\n }\n }\n p.length = p.length - deleteCount;\n }\n if (lastRecordVariables) {\n let diff: Partial<RecordVariableType> = {};\n for (let k in _recordVariables) {\n if (_recordVariables[k] !== lastRecordVariables[k]) {\n diff[k] = _recordVariables[k];\n }\n }\n records[currentRecordIndex].d.push({ p, v: diff });\n } else {\n records[currentRecordIndex].d.push({ p, v: {} });\n }\n lastRecordVariables = { ..._recordVariables };\n autoSave();\n return p;\n }\n\n export const autoSave = throttle(saveRecord, 1000, true);\n export const autoUpload = throttle(uploadRecord, 5000, true);\n\n export async function uploadRecord() {\n if (_inTransaction) return;\n console.log(\"准备上传云存档\");\n SDK.uploadGameRecord({ g: _globalVariables, r: records, p: plotsInfo, v: _recordVersion });\n }\n\n export function overwriteRecordWithData(data: string | Object, upload = true) {\n if (typeof data === \"string\") data = JSON.parse(data);\n for (let k in _globalVariables) {\n delete _globalVariables[k];\n }\n while (records.length) {\n records.pop();\n }\n _recordVersion = data[\"v\"];\n Object.assign(_globalVariables, data[\"g\"]);\n Object.assign(records, data[\"r\"]);\n Object.assign(plotsInfo, data[\"p\"]);\n saveRecord(upload);\n }\n\n export function getRecordAsString() {\n return JSON.stringify({ g: _globalVariables, r: records, p: plotsInfo, v: _recordVersion });\n }\n\n export function saveRecord(upload = true) {\n if (_inTransaction) return;\n if (globalVarDirty) {\n LocalStorage.setObject(GameConfig.gameId + \".gameGlobalVars\", _globalVariables);\n }\n LocalStorage.setObject(GameConfig.gameId + \".gameRecords\", records);\n LocalStorage.setObject(GameConfig.gameId + \".plotsInfo\", plotsInfo);\n _recordVersion = (new Date).getTime();\n LocalStorage.setInt(GameConfig.gameId + \".recordVersion\", _recordVersion);\n upload && autoUpload();\n }\n\n export function emptyRecords() {\n LocalStorage.remove(GameConfig.gameId + \".gameGlobalVars\");\n LocalStorage.remove(GameConfig.gameId + \".gameRecords\");\n LocalStorage.remove(GameConfig.gameId + \".plotsInfo\");\n LocalStorage.remove(GameConfig.gameId + \".recordVersion\");\n for (let k in _globalVariables) {\n delete _globalVariables[k];\n }\n while (records.length) {\n records.pop();\n }\n for (let k in plotsInfo) {\n delete plotsInfo[k];\n }\n _recordVersion = 0;\n _initailized = false;\n initRecords();\n return uploadRecord();\n }\n\n export function rollbackToIndex(index: number, preserveVars?: string[]) {\n if (index < 0 || index >= records[currentRecordIndex].d.length) return false;\n let currRecords = records[currentRecordIndex].d;\n currRecords.length = index + 1;\n currRecords[index].s = undefined;\n let preserves: { [key: string]: string | number } = {};\n if (preserveVars) {\n for (let v of preserveVars) {\n preserves[v] = _recordVariables[v];\n } \n }\n for (let k in _recordVariables) { // clear all variables\n delete _recordVariables[k];\n }\n Object.assign(_recordVariables, defaultRecordVariables);\n for (let i = 0; i <= index; i++) {\n let data = currRecords[i];\n Object.assign(_recordVariables, data.v);\n }\n Object.assign(_recordVariables, preserves);\n lastRecordVariables = { ..._recordVariables };\n autoSave();\n return true;\n }\n\n export function rollbackToPlot(plot: number, reverseFind = false, preserveVars?: string[]) {\n let items = records[currentRecordIndex].d;\n let index = 0;\n if (reverseFind) {\n index = items.length - 1;\n for (; index >= 0; index--) {\n if (items[index].p.findIndex(p => p === plot) >= 0) {\n break;\n }\n }\n } else {\n index = items.findIndex(v => v.p.findIndex(p => p === plot) >= 0);\n }\n if (index < 0) {\n throw new Error(\"Plot \" + plot + \" not found!\");\n }\n return rollbackToIndex(index, preserveVars);\n }\n}\n\nif (GameConfig.debug) {\n (window as any).GameRecord = GameRecord;\n}"]}