import { makeAutoObservable, } from 'mobx';
import { MAX_LEVEL } from "@/pages/GamePage/Level/LevelConfig.ts";

class GameStore {

  constructor() {
    makeAutoObservable(this);
  }

  gameInfo = {
    levelIndex: 1,
    levelArr: [],
  }

  async start() {
    this.gameInfo.levelArr = new Array(MAX_LEVEL).fill(0).map((item, index) => {
      return index + 1;
    });
    this.gameInfo.levelArr.sort((a, b) => Math.random() - 0.5);
    this.gameInfo.levelIndex = 0;
  }

  async submit() {

    const score = this.gameInfo.levelIndex;

  }
}

export default (new GameStore());
