AVG.js
7.33 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
(function() {
var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
var __module = nodeEnv ? module : {exports:{}};
var __filename = 'preview-scripts/assets/script/avg/AVG.js';
var __require = nodeEnv ? function (request) {
return cc.require(request);
} : function (request) {
return __quick_compile_project__.require(request, __filename);
};
function __define (exports, require, module) {
if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, '07c7epTX2ZIYIs33/mYkM6q', 'AVG');
// script/avg/AVG.ts
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
}
Object.defineProperty(exports, "__esModule", { value: true });
exports.richNodeTextCount = exports.richNodesToCocosString = exports.ActionManager = exports.GameRecord = exports.PlotManager = exports.initAVG = void 0;
const simba_avg_core_1 = require("simba-avg-core");
Object.defineProperty(exports, "PlotManager", { enumerable: true, get: function () { return simba_avg_core_1.PlotManager; } });
const ActionManager_1 = require("simba-avg-core/dist/ActionManager");
Object.defineProperty(exports, "ActionManager", { enumerable: true, get: function () { return ActionManager_1.ActionManager; } });
const GameRecord_1 = require("simba-avg-core/dist/game-data/GameRecord");
const RichTextUtils_1 = require("simba-avg-core/dist/utils/RichTextUtils");
Object.defineProperty(exports, "richNodesToCocosString", { enumerable: true, get: function () { return RichTextUtils_1.richNodesToCocosString; } });
Object.defineProperty(exports, "richNodeTextCount", { enumerable: true, get: function () { return RichTextUtils_1.richNodeTextCount; } });
const simba_sdk_1 = require("simba-sdk");
const GameConfig_1 = require("../GameConfig");
const GameVariables_1 = require("./game-data/GameVariables");
async function retrieveRecord() {
return simba_sdk_1.SDK.getGameRecord();
}
async function saveRecord(record) {
simba_sdk_1.SDK.uploadGameRecord(record);
}
function initAVG() {
const USE_CDN_PLOTS = false;
return simba_avg_core_1.init(GameConfig_1.GameConfig.gameId, "", {
cdnUrl: USE_CDN_PLOTS ? GameConfig_1.GameConfig.cdnUrl : "", defaultGlobalVariables: GameVariables_1.defaultGlobalVariables, defaultRecordVariables: GameVariables_1.defaultRecordVariables,
globalVariableConstrains: GameVariables_1.globalVariableConstrains, recordVariableConstrains: GameVariables_1.recordVariableConstrains, retrieveRecord, saveRecord
});
}
exports.initAVG = initAVG;
let GameRecord = GameRecord_1.GameRecordBase;
exports.GameRecord = GameRecord;
__exportStar(require("simba-avg-core/dist/game-data/PlotsData"), exports);
__exportStar(require("simba-avg-core/dist/model/ActionModel"), exports);
__exportStar(require("simba-avg-core/dist/model/ConditionModel"), exports);
__exportStar(require("simba-avg-core/dist/model/PlotModel"), exports);
__exportStar(require("simba-avg-core/dist/model/RichTextModel"), exports);
cc._RF.pop();
}
if (nodeEnv) {
__define(__module.exports, __require, __module);
}
else {
__quick_compile_project__.registerModuleFunc(__filename, function () {
__define(__module.exports, __require, __module);
});
}
})();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0cy9zY3JpcHQvYXZnL0FWRy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsbURBQW1EO0FBbUMxQyw0RkFuQ00sNEJBQVcsT0FtQ047QUFsQ3BCLHFFQUFrRTtBQWtDaEMsOEZBbEN6Qiw2QkFBYSxPQWtDeUI7QUFqQy9DLHlFQU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