import { ui } from "../ui/layaMaxUI";
import { SC, ViewManager, ViewType } from "./ViewManager";
import { EventManager, StageState } from "../Tools/EventManager";

export default class MainGameView extends ui.MainGameViewUI implements SC{
    private static ins:MainGameView;
    constructor()
    {
        super();
        MainGameView.ins = this;
    }
    public static get Instance():MainGameView{
        if(MainGameView.ins){
            return MainGameView.ins
        }
        else{
            return new MainGameView();
        }
    }
    Show(){
        this.StartBtn.clickHandler = Laya.Handler.create(this,this.ClickStart);

    }
    Close(){

    }
    ClickStart(){
        EventManager.StageTrigger(StageState.Start);
        ViewManager.Instance.ShowView(ViewType.IngameView);
    }
    

}