import Func from '@/Engine/ECS/Function';
import LoginHandle from './Handlers/LoginHandler';
import PlatformMenuHandle from './Handlers/PlatformMenuHandle';
import DataMeterHandle from './Handlers/DataMeterHandler';
import { FuncPageMenuState } from './LevelAFunctions/FuncPageMenu';
export enum FuncMainState {
  Login, // 登录页
  PlatformMenu, // 首页
  ProjectSelection, // 项目选择页
  PageMenu, // 菜单页
  Map,
  DataMeter,
}

export default class FuncMain extends Func<FuncMainState> {
  constructor(name: string) {
    super(name);
    super.initStates((sm) => {
      // sm.addState(
      //   FuncMainState.ProjectSelection,
      //   () => window.GT_APP.funcProjectSelection.setActive(true),
      //   () => null,
      //   () => window.GT_APP.funcProjectSelection.setActive(false),
      // );

      // sm.addState(FuncMainState.Login, new LoginHandle());
      // sm.addState(FuncMainState.DataMeter, new DataMeterHandle());
      // sm.addState(FuncMainState.PlatformMenu, new PlatformMenuHandle());
      // sm.addState(
      //   FuncMainState.Map,
      //   () => window.GT_APP.funcMap.setActive(true),
      //   () => null,
      //   () => window.GT_APP.funcMap.setActive(false),
      // );
      sm.addState(FuncMainState.PlatformMenu, () => {
        window.GT_APP.funcPageMenu.setActive(true);
        window.GT_APP.funcPageMenu.changeState(FuncPageMenuState.ProjectDetail);
      }, null, null);
    });
  }
}
