import Singleton from "../../../extensions/ngame/assets/ngame/util/Singleton";
import { app } from "../App";
import PlayerData from "../data/PlayerData";
import PlayerPetData from "../data/PlayerPetData";
import { GUI } from "../ui/UIConfig";

export default class NoviceManager extends Singleton{

    //新手引导执行
    async onStart(){

        //获取玩家信息是否引导过
        if(!(PlayerData.getIns().data.novice)){
            //如果没有过引导则打开引导页面
            await app.layer.OpenToClose(GUI.NoviceNamingView);
        }

        //获取玩家信息是否选择过宠物(有没有宠物)
        //如果没有宠物则弹出让玩家选择宠物
        if(PlayerPetData.getIns().getData().length == 0){
            //没有宠物则弹出选择宠物页面
            await app.layer.OpenToClose(GUI.NoviceSelectPetView);
        }

        console.log("新手引导结束");

    }

}

