mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 03:14:47 +00:00
33 lines
779 B
TypeScript
33 lines
779 B
TypeScript
|
import { API, EquipForgingBench, PetEquip } from "../consts/API";
|
||
|
import BaseData from "./BaseData";
|
||
|
import PlayerPetData from "./PlayerPetData";
|
||
|
|
||
|
//宠物装备数据类
|
||
|
export default class PetEquipData extends BaseData{
|
||
|
|
||
|
//装备
|
||
|
equips:PetEquip[];
|
||
|
//锻造台
|
||
|
info:EquipForgingBench;
|
||
|
|
||
|
//锻造台是否有宠物
|
||
|
get isForgingBenchPet(){
|
||
|
return !!PlayerPetData.getIns().petIdQueryPetInfo(this.info.forgingPetId);
|
||
|
}
|
||
|
|
||
|
async onInit() {
|
||
|
this.equips = await API.PetEquipAll();
|
||
|
this.info = await API.PetEquipForgingInfo();
|
||
|
}
|
||
|
|
||
|
//锻造
|
||
|
async forging(){
|
||
|
await API.PetEquipForging();
|
||
|
}
|
||
|
|
||
|
//设置锻造宠
|
||
|
async setForgingPetId(petId:number){
|
||
|
await API.PetEquipForgingPetId(petId);
|
||
|
}
|
||
|
|
||
|
}
|