You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.6 KiB
54 lines
1.6 KiB
2 months ago
|
|
||
|
import TaskManager, { MainTaskIdEnum } from "../JuQingChat/TaskManager";
|
||
|
import BagManager from "./BagManager";
|
||
|
import InterfaceManager from "./InterfaceManager";
|
||
|
|
||
|
|
||
|
|
||
|
export default class QinWangLingManager{
|
||
|
static gameConfigs = [];
|
||
|
|
||
|
public static getManagerConfigs(){
|
||
|
return this.gameConfigs
|
||
|
}
|
||
|
|
||
|
|
||
|
public static initManager(callFunc){
|
||
|
let self = this
|
||
|
cc.loader.loadRes('Json/gameConfig/qinWangLing.json', function (err, gameconfig) {
|
||
|
if (err) {
|
||
|
console.log(err);
|
||
|
return;
|
||
|
}
|
||
|
self.gameConfigs = gameconfig.json;
|
||
|
// console.log("游戏配置加载成功", self.gameConfigs);
|
||
|
callFunc()
|
||
|
});
|
||
|
}
|
||
|
|
||
|
public static getCurGoodList(){
|
||
|
//将任务/剧情道具替换掉最后的商品
|
||
|
let daoYeList = InterfaceManager.getDaoyeList()
|
||
|
let replaceGoodsTab = []
|
||
|
for(let i=0;i<daoYeList.length;i++){
|
||
|
let goodId = daoYeList[i].goodId
|
||
|
if(daoYeList[i].gameType == '秦王陵' && BagManager.getBagGoodNums(goodId) <= 0){
|
||
|
replaceGoodsTab.push(BagManager.getJuQingGoodConfig(goodId))
|
||
|
}
|
||
|
}
|
||
|
let mainTaskInfo:any = TaskManager.getCurUnLockMainTaskInfo()
|
||
|
let mainId = mainTaskInfo.Id
|
||
|
|
||
|
|
||
|
let useConfig = []
|
||
|
for(let i=0;i<this.gameConfigs.length-replaceGoodsTab.length;i++){
|
||
|
useConfig.push(this.gameConfigs[i])
|
||
|
}
|
||
|
for(let j=0;j<replaceGoodsTab.length;j++){
|
||
|
useConfig.push(replaceGoodsTab[j])
|
||
|
}
|
||
|
return useConfig
|
||
|
}
|
||
|
|
||
|
}
|