29 lines
653 B
TypeScript
29 lines
653 B
TypeScript
import { Logger } from "../../../../core_tgx/base/utils/Logger";
|
|
import {ISectCfg as ISectCfg} from "../../../../../../tgx-games-config/interface/ISectCfg";
|
|
|
|
export default class SectDataManager
|
|
{
|
|
private _data: Array<ISectCfg> | undefined;
|
|
init(data: any): void
|
|
{
|
|
this._data = data;
|
|
Logger.info(`配置数据(ICardCfg2)加载完毕...`);
|
|
}
|
|
|
|
|
|
getData(id: number):ISectCfg
|
|
{
|
|
if (this._data)
|
|
{
|
|
return this._data.find(p=>p.id == id);
|
|
}
|
|
console.log("配置数据(ICardCfg2)不存在"+id);
|
|
return null;
|
|
}
|
|
|
|
getAllData(){
|
|
return this._data;
|
|
}
|
|
|
|
}
|