import { GameProp } from "../../game/data/GameData";


/**
 * 新手引导模块
 */
export default class GuideSystem {

    private crtGuideID: number;

    public open(id) {
        this.crtGuideID = gData.gameData.getProp(GameProp.guideID);
        if (id == 9999) {
            mk.console.log("新手引导已做完");
            return;
        }
        if (id >= this.crtGuideID && this.crtGuideID > 0) {
            mk.console.log("当前引导已做过：" + id);
            return;
        }
        gData.guideData.crtID = id;
        this.crtGuideID = id;
        mk.ui.openPanel("module/guide/guide");
    }

    public close() {
        this.crtGuideID++;
        let guide = gData.guideData.getGuidesByID(this.crtGuideID);
        if (guide == null) {
            this.crtGuideID = 9999;
        }
        gData.gameData.setProp(GameProp.guideID, this.crtGuideID);
    }
}
