38 lines
806 B
TypeScript
Raw Normal View History

2023-12-03 03:31:19 +08:00
import { app } from "../App";
import { API } from "../consts/API";
2023-12-02 02:13:22 +08:00
import { GAPI, ModeOnHookOV } from "../consts/GAPI";
2023-12-03 03:31:19 +08:00
import { GUI } from "../ui/UIConfig";
2023-12-02 02:13:22 +08:00
import BaseData from "./BaseData";
//无限模式数据类
export default class GOnHookData extends BaseData{
info:ModeOnHookOV;
async onInit() {
2023-12-25 02:06:56 +08:00
await this.onUpdateInfo();
2023-12-02 02:13:22 +08:00
console.log("GOnHookData Info",this.info);
}
2023-12-25 02:06:56 +08:00
//刷新数据
async onUpdateInfo(){
this.info = await GAPI.GOnHookInfo();
}
2023-12-03 03:31:19 +08:00
//切换地图
async setMap(mapId:number){
this.info = await GAPI.GOnHookSetMap(mapId);
app.layer.Open(GUI.Tips,{text:"切换地图成功"});
}
2023-12-25 02:06:56 +08:00
//下一关
async onNextLevel(){
await GAPI.GOnHookNextLevel();
await this.onUpdateInfo();
}
2023-12-02 02:13:22 +08:00
}