import Func from '@/Engine/ECS/Function';
import SysPage from '@/Frameworks/SysPage';
import { STORAGE_TYPE, LocalService } from '@/Frameworks/SysStorage';
import { PAGE_KEY } from '@/Project/constants';
import { FuncMainState } from '../FuncMain';

export enum FuncDataMeterState {
  idle,
}

export default class FuncDataMeter extends Func<FuncDataMeterState> {
  constructor(name: string) {
    super(name);
    super.initStates((sm) => {
      sm.addState(
        FuncDataMeterState.idle,
        this.onIdleStateIn,
        null,
        this.onIdleStateExit,
      );
    });
  }
  onIdleStateIn(): void {
    SysPage.add(PAGE_KEY.DataMeter);
  }
  onIdleStateExit(): void {
    SysPage.removeByKey(PAGE_KEY.DataMeter);
  }
}
