8893e0c9-f6fe-4757-ad89-badb269069f0.js
1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
"use strict";
cc._RF.push(module, '8893eDJ9v5HV62JutsmkGnw', 'MessageSceneModel');
// script/game/model/MessageSceneModel.ts
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MessageSceneModel = void 0;
const AVG_1 = require("../../avg/AVG");
const simba_config_manager_1 = require("simba-config-manager");
const MessageSceneConfig_1 = require("../../config/MessageSceneConfig");
class MessageSceneModel {
constructor(id) {
this._id = id;
this._recordKey = "m" + this._id;
}
get id() { return this._id; }
get config() { return simba_config_manager_1.ConfigManager.getConfig(MessageSceneConfig_1.messageSceneConfig, this._id); }
get firstPlot() { return this._firstPlot; }
set firstPlot(plot) {
this._firstPlot = plot;
AVG_1.GameRecord.recordVariables[this._recordKey + ".f"] = plot.id;
}
get lastPlot() { return this._lastPlot; }
set lastPlot(plot) {
if (this._lastPlot === plot)
return;
this._lastPlot = plot;
if (plot) {
AVG_1.GameRecord.recordVariables[this._recordKey + ".l"] = plot.id;
}
}
async initFromRecords() {
let firstPlotId = AVG_1.GameRecord.recordVariables[this._recordKey + ".f"];
let lastPlotId = AVG_1.GameRecord.recordVariables[this._recordKey + ".l"];
this._firstPlot = (await AVG_1.getPlot(firstPlotId));
if (lastPlotId !== undefined) {
this._lastPlot = await AVG_1.getPlot(lastPlotId);
}
}
}
exports.MessageSceneModel = MessageSceneModel;
cc._RF.pop();