import { ViewConst, ViewType } from "../ConstDefine/ViewConst"
import AppFacade from "../AppFacade"
import LayerMgr from "..//Manager/LayerMgr"
import ViewMgr from "..//Manager/ViewMgr"
import FullView from "./FullView"

/**
 * UI全屏界面
 */
export default abstract class UIFullView extends FullView{
    
    public abstract getTypeName():string
    public getViewType():ViewType{return ViewType.UIFullView}

    protected setLayer(){
        super.setLayer()
        this.changeLayer()
    }

    protected changeLayer(){
        let layer=AppFacade.getMgr(LayerMgr)
        layer.setLayer(this.node,layer.UiLayer)
    }

    public close(){
        super.close()
        AppFacade.getMgr(ViewMgr).releaseView(this.getTypeName(),ViewConst.ReleaseTime.UI)
    }
}