fix : play board optimization

This commit is contained in:
GuillaumeSD
2024-03-20 00:56:40 +01:00
parent 438ec60107
commit aca8910bab
7 changed files with 45 additions and 10 deletions

View File

@@ -1,8 +1,13 @@
import { GameData } from "@/hooks/useGameData";
import { Color } from "@/types/enums";
import { Chess } from "chess.js";
import { atom } from "jotai";
export const gameAtom = atom(new Chess());
export const gameDataAtom = atom<GameData>({
history: [],
lastMove: undefined,
});
export const playerColorAtom = atom<Color>(Color.White);
export const engineSkillLevelAtom = atom<number>(1);
export const isGameInProgressAtom = atom(false);