This commit is contained in:
Maciej Caderek
2022-02-07 18:49:17 +01:00
parent 4fa2ba1fb9
commit f2d6c080d4
20 changed files with 1749 additions and 127 deletions

40
src/state.ts Normal file
View File

@@ -0,0 +1,40 @@
import { createStore } from "solid-js/store";
import { BoardConfig, GameConfig } from "./types";
import styles from "./board/styles-board";
const boardConfig: BoardConfig = {
size: 1024,
boardStyle: styles.calm,
piecesStyle: "tatiana",
showBorder: true,
showExtraInfo: true,
showMaterial: true,
showMoveIndicator: true,
showChecks: true,
showCoords: true,
flipped: false,
};
const gameConfig: GameConfig = {
titleScreen: true,
fromPly: null,
toPly: null,
loop: true,
};
export type State = {
board: BoardConfig;
game: GameConfig;
moves: string[];
};
const initialState: State = {
board: boardConfig,
game: gameConfig,
moves: [],
};
const [state, setState] = createStore(initialState);
export { state, setState };