import Func from '@/Engine/ECS/Function';
import LoginHandle from './Handlers/LoginHandler';
import AppPlatformHandle from './Handlers/PlatformMenuHandle';
import { PAGE_KEY } from '../constants';
import SysPage from '@/Frameworks/SysPage';
import PlatformMenuHandle from './Handlers/PlatformMenuHandle';

export enum FuncMainState {
  Login, // 登录页
  PlatformMenu, // 首页
  ProjectSelection, // 项目选择页
  PageMenu, // 菜单页
}

export default class FuncMain extends Func<FuncMainState> {
  constructor(name: string) {
    super(name);
    super.initStates((sm) => {
      sm.addState(FuncMainState.Login, new LoginHandle());
      sm.addState(
        FuncMainState.PlatformMenu,
        () => window.GT_APP.funcPlatformMenu.setActive(true),
        () => null,
        () => window.GT_APP.funcPlatformMenu.setActive(false),
      );
    });
  }
}
