import { Logger } from "../../../../core_tgx/base/utils/Logger"; import { ITreasureCfg } from "../../../../module_basic/shared/configs/interface/ITreasureCfg"; export default class TreasureDataManager { private _data: Array | undefined; init(data: any): void { this._data = data; Logger.info(`配置数据(ITreasureCfg)加载完毕...`); } getData(id: number):ITreasureCfg { if (this._data) { return this._data.find(p=>p.id == id); } console.log("配置数据(ITreasureCfg)不存在"+id); return null; } getAllData(){ return this._data; } }