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,GAAG,KAAK,CAAW,IAAI,EAAE,CAAC;IACnF,CAAC;IAGD,IAAI,OAAO,KAAK,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvC,IAAI,OAAO,CAAC,OAAgB;QACxB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC5B,CAAC;CACJ;AAxDD,sDAwDC","file":"","sourceRoot":"/","sourcesContent":["import { ConfigManager } from \"simba-config-manager\";\nimport { GameRecord, getPlot, ReadonlyPlot } from \"../../avg/AVG\";\nimport { DateType } from \"../../avg/EditorEnums\";\nimport { dateSceneConfig } from \"../../config/DateSceneConfig\";\nimport { GameModelManager } from \"./GameModelManager\";\n\n/**\n * 剧情状态\n */\nexport enum DatingEventStatus {\n /**剧情未解锁 */\n Locked = 1,\n /**新剧情 */\n New,\n /**剧情在进度中 */\n InProgress,\n /**完成剧情 */\n Completed\n}\n\nexport class DatingEventSceneModel {\n private _id: number;\n get id() { return this._id }\n get config() { return ConfigManager.getConfig(dateSceneConfig, this._id); }\n\n private _status: DatingEventStatus;\n get status() { return this._status; }\n set status(v: DatingEventStatus) {\n if (this._status !== v) {\n this._status = v;\n GameRecord.recordVariables[this._recordKey + \".s\"] = v;\n }\n }\n\n private _firstPlot: ReadonlyPlot;\n get firstPlot() { return this._firstPlot; }\n set firstPlot(plot: ReadonlyPlot) {\n this._firstPlot = plot;\n GameRecord.recordVariables[this._recordKey + \".f\"] = plot.id;\n }\n\n private _bg: string;\n get background() { return this._bg; }\n set background(bg: string) {\n this._bg = bg;\n GameRecord.recordVariables[this._recordKey + \".bg\"] = bg;\n }\n\n private _recordKey: string;\n\n constructor(id: number) {\n this._id = id;\n this._recordKey = \"de\" + this._id;\n this._bg = \"\";\n }\n\n async initFromRecords() {\n this._status = GameRecord.recordVariables[this._recordKey + \".s\"] as number || DatingEventStatus.Locked;\n let inProgress = GameModelManager.checkBranchIsInProgress(this.id);\n if (inProgress) {\n this._status = DatingEventStatus.InProgress;\n }\n let comp = GameModelManager.checkBranchIsComplete(this.id);\n if (comp) {\n this._status = DatingEventStatus.Completed;\n }\n let firstPlotId = this.config.DateType === DateType.Date_Normal ? GameRecord.recordVariables[this._recordKey + \".f\"] as number : this.config.start_plot_id;\n this._firstPlot = (await getPlot(firstPlotId))!;\n this._bg = GameRecord.recordVariables[this._recordKey + \".bg\"] as string || \"\";\n }\n\n private _isExtra: boolean = false;\n get isExtra() { return this._isExtra; }\n set isExtra(isExtra: boolean) {\n this._isExtra = isExtra;\n }\n}"]}