cd8a0e54-0c6d-4f70-b8ed-9abff8bf655e.js 1.71 KB
"use strict";
cc._RF.push(module, 'cd8a05UDG1PcLjtmr/4v2Ve', 'IntroTableMgr');
// scripts/kernel/table/IntroTableMgr.ts

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IntroTableMgr = void 0;
var Global_1 = require("../../Global");
var TableDefine_1 = require("./TableDefine");
var IntroTableMgr = /** @class */ (function () {
    function IntroTableMgr() {
        this._levelList = [];
        this._idList = [];
    }
    Object.defineProperty(IntroTableMgr, "ins", {
        get: function () {
            if (this._ins == null) {
                this._ins = new IntroTableMgr();
                var all = Global_1.tMgr.map[TableDefine_1.TableName.INTRO];
                for (var key in all) {
                    if (Object.prototype.hasOwnProperty.call(all, key)) {
                        if (!Number(key)) {
                            continue;
                        }
                        var element = all[key];
                        if (element.Level > 0) {
                            this._ins._levelList.push(element.Level);
                            this._ins._idList.push(element.ID);
                        }
                    }
                }
            }
            return this._ins;
        },
        enumerable: false,
        configurable: true
    });
    IntroTableMgr.prototype.getTableByLevel = function (level) {
        var index = this._levelList.indexOf(level);
        if (index > -1) {
            var id = this._idList[index];
            return Global_1.tMgr.getConfig(TableDefine_1.TableName.INTRO, id);
        }
        return null;
    };
    IntroTableMgr._ins = null;
    return IntroTableMgr;
}());
exports.IntroTableMgr = IntroTableMgr;

cc._RF.pop();