# Conflicts:
#	JisolGameCocos/assets/script/App.ts
This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2024-01-23 02:54:23 +08:00
13 changed files with 81 additions and 15 deletions

View File

@@ -0,0 +1,43 @@
import { TD } from "../App";
import { Dungeon, GAPI } from "../consts/GAPI";
import BaseData from "./BaseData";
export default class DungeonData extends BaseData{
info:{[key:string]:Dungeon};
async onInit() {
await this.UpdateInfo();
}
//获取信息
async getInfo(){
if(this.info){
return this.info;
}else{
return await this.UpdateInfo();
}
}
//更新信息
async UpdateInfo(){
return this.info = await GAPI.GDungeonGetInfo();
}
//获取指定Id的进度
async getInfoProcess(id:number){
return ((await this.getInfo())[`${id}`] as Dungeon).dungeonCfgItemId;
}
//获取指定副本的最大关卡
getMaxProcess(id:number){
let datas = TD[`TbGSysDungeon${160001}`].getDataList();
return datas[datas.length - 1].id;
}
//挑战
async challenge(dungeonId:number,dungeonItemId:number){
this.info = await GAPI.GDungeonChallenge(dungeonId,dungeonItemId)
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "cae80288-0426-4c67-a214-3f3191e51411",
"files": [],
"subMetas": {},
"userData": {}
}