import Func from '@/Engine/ECS/Function';
import FuncProjectDetail from '@/Project/Functions/LevelBFunctions/FuncProjectDetail';

export enum FuncPageMenuState {
  Menu, // 菜单栏页面
  DataMeter, // 驾驶舱
  DataCenterBuild, // 数据中心-建设
  DataCenterOps, // 数据中心-运营
  FlowManage, // 流程管理
  ProjectDetail, // 水厂详情
  ProductionManage, // 生产管理
  DeviceManage, // 设备管理
  SafetyManage, // 安全管理
  LimitedSpace, // 有限空间
  ConfigManage, // 配置管理
}

export default class FuncPageMenu extends Func<FuncPageMenuState> {

  private funcProjectDetail: FuncProjectDetail;
  constructor(name: string) {
    super(name);
    this.openLog = true;
    this.funcProjectDetail = new FuncProjectDetail("FuncProjectDetail");
    super.initStates((sm) => {
      // sm.addState(FuncMainState.Login, new LoginHandle());
      sm.addState(FuncPageMenuState.ProjectDetail, this.onProjectDetailStateIn.bind(this), null, this.onProjectDetailStateOut.bind(this))
    });
  }

  onProjectDetailStateIn(): void {
    this.funcProjectDetail.setActive(true);
  }

  onProjectDetailStateOut(): void {
    this.funcProjectDetail.setActive(false);
  }
}

