54dbdb58-3fb9-4447-8677-2c2b6f93cc00.js
1.92 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
"use strict";
cc._RF.push(module, '54dbdtYP7lER4Z3LCtvk8wA', 'GameSceneObjTableMgr');
// scripts/kernel/table/GameSceneObjTableMgr.ts
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GameSceneObjTableMgr = void 0;
var Global_1 = require("../../Global");
var TableDefine_1 = require("./TableDefine");
var GameSceneObjTableMgr = /** @class */ (function () {
function GameSceneObjTableMgr() {
this._map = new Map();
}
Object.defineProperty(GameSceneObjTableMgr, "ins", {
get: function () {
if (this._ins == null) {
this._ins = new GameSceneObjTableMgr();
var all = Global_1.tMgr.map[TableDefine_1.TableName.GAME_SCENE_OBJ];
for (var i = 0; i < 3; ++i) {
this._ins._map.set(i + 1, []);
}
for (var key in all) {
if (Object.prototype.hasOwnProperty.call(all, key)) {
if (!Number(key)) {
continue;
}
var element = all[key];
this._ins._map.get(element.SceneId).push(element);
}
}
}
return this._ins;
},
enumerable: false,
configurable: true
});
// getBy
GameSceneObjTableMgr.prototype.getByScene = function (scendId) {
return this._map.get(scendId);
};
GameSceneObjTableMgr.prototype.getParentObj = function (obj) {
var sceneObj = this.getByScene(obj.SceneId);
for (var i = 0; i < sceneObj.length; i++) {
var element = sceneObj[i];
if (element.Unlock.includes(obj.ID)) {
return element;
}
}
return null;
};
GameSceneObjTableMgr._ins = null;
return GameSceneObjTableMgr;
}());
exports.GameSceneObjTableMgr = GameSceneObjTableMgr;
cc._RF.pop();