feat : add click on engine lines

This commit is contained in:
GuillaumeSD
2025-05-11 18:21:45 +02:00
parent 74a2adbb7d
commit 6535fce2f4
22 changed files with 285 additions and 156 deletions

View File

@@ -23,7 +23,7 @@ export default function BoardContainer() {
const game = useAtomValue(gameAtom);
const { white, black } = usePlayersData(gameAtom);
const playerColor = useAtomValue(playerColorAtom);
const { makeMove: makeGameMove } = useChessActions(gameAtom);
const { playMove } = useChessActions(gameAtom);
const engineElo = useAtomValue(engineEloAtom);
const isGameInProgress = useAtomValue(isGameInProgressAtom);
@@ -41,7 +41,7 @@ export default function BoardContainer() {
return;
}
const move = await engine.getEngineNextMove(gameFen, engineElo);
if (move) makeGameMove(uciMoveParams(move));
if (move) playMove(uciMoveParams(move));
};
playEngineMove();