import { API, PlayerInfoOV, PlayerPetOV } from "../consts/API"; import BaseData from "./BaseData"; //玩家宠物数据 export default class PlayerPetData extends BaseData{ //玩家宠物列表 datas:PlayerPetOV[] = []; async onInit() { //更新玩家宠物 await this.UpdatePlayerPet(); } //获取全部宠物 getData(){ return this.datas; } //更新玩家宠物 async UpdatePlayerPet(){ //获取全部宠物 this.datas = await API.GetPlayerPets(); } //选择宠物 async SelectNovicePet(petId:number){ await API.SelectNovicePet(petId); //更新玩家宠物列表 await this.UpdatePlayerPet(); } }