squidGame/tgx-games-client/assets/module_arean/scripts/DataConfig/Managers/BoxDataManager.ts

40 lines
1.1 KiB
TypeScript
Raw Normal View History

2025-02-07 10:49:34 +08:00
/************************************************************************************
* FileName : BoxDataManager.ts
* Description :
* Version : v1.0.0
* CreateTime : 2024-12-17 10:04:40
* Author :
* Copyright (c) since 2024
* ==============================================================
* Method Description:
*
* ==============================================================
************************************************************************************/
import {Logger} from "db://assets/core_tgx/base/utils/Logger";
import {IBoxCfg} from "db://assets/module_basic/shared/configs/interface/IBoxCfg";
/** 宝箱表 */
export default class BoxDataManager {
private _data: Array<IBoxCfg> | undefined;
init(data: any): void
{
this._data = data;
Logger.info(`配置数据(IBoxCfg)加载完毕...`);
}
getData(id: number):IBoxCfg
{
if (this._data)
{
return this._data.find(p=>p.id == id);
}
console.log("配置数据(IBoxCfg)不存在"+id);
return null;
}
getAllData() : IBoxCfg[]{
return this._data;
}
}