76c3564f-f23b-4e52-bb82-062165f70a23.js.map
1.47 KB
{"version":3,"sources":["assets/script/common/gameplay/managers/ConfigManager.ts"],"names":[],"mappings":";;;;;;;AAAA,mDAAgD;AAGhD,IAAiB,aAAa,CAe7B;AAfD,WAAiB,aAAa;IAC1B,IAAI,UAAkE,CAAC;IAEhE,KAAK,UAAU,cAAc;QAChC,UAAU,GAAG,MAAM,mBAAQ,CAAC,OAAO,CAAM,eAAe,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC;QACxE,mBAAQ,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;IACzC,CAAC;IAHqB,4BAAc,iBAGnC,CAAA;IAED,SAAgB,SAAS,CAAI,MAAkC,EAAE,EAAU;QACvE,OAAO,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAoB,CAAC;IAC1D,CAAC;IAFe,uBAAS,YAExB,CAAA;IAED,SAAgB,YAAY,CAAI,MAAkC;QAC9D,OAAO,UAAU,CAAC,MAAM,CAAC,IAAI,CAAuC,CAAC;IACzE,CAAC;IAFe,0BAAY,eAE3B,CAAA;AACL,CAAC,EAfgB,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAe7B","file":"","sourceRoot":"/","sourcesContent":["import { ResUtils } from \"../../utils/ResUtils\";\r\nimport { DeepReadonly } from \"simba-utils\";\r\n\r\nexport namespace ConfigManager {\r\n let configData: DeepReadonly<{ [key: string]: { [key: string]: {} } }>;\r\n\r\n export async function initConfigData() {\r\n configData = await ResUtils.loadRes<any>(\"config/config\", cc.JsonAsset);\r\n ResUtils.releaseRes(\"config/config\");\r\n }\r\n\r\n export function getConfig<T>(config: { name: string, type?: T }, id: number): DeepReadonly<T> {\r\n return configData[config.name][id] as DeepReadonly<T>;\r\n }\r\n\r\n export function getAllConfig<T>(config: { name: string, type?: T }): DeepReadonly<{ [key: number]: T }> {\r\n return configData[config.name] as DeepReadonly<{ [key: number]: T }>;\r\n }\r\n}"]}