mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交
This commit is contained in:
43
JisolGameCocos/assets/script/data/DungeonData.ts
Normal file
43
JisolGameCocos/assets/script/data/DungeonData.ts
Normal 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)
|
||||
}
|
||||
|
||||
}
|
9
JisolGameCocos/assets/script/data/DungeonData.ts.meta
Normal file
9
JisolGameCocos/assets/script/data/DungeonData.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "cae80288-0426-4c67-a214-3f3191e51411",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
Reference in New Issue
Block a user