redraw cards

This commit is contained in:
Gavin McDonald
2025-06-12 11:53:35 -04:00
parent 5c18b8afbf
commit e75d9b41bc
6 changed files with 79 additions and 9 deletions

View File

@@ -78,6 +78,15 @@ export default function GamePage() {
socket.emit('flip-card', flip);
};
const redraw = (cardIndex: number) => {
const redraw: ClientUpdate = {
gameID,
cardIndex,
};
socket.emit('redraw', redraw);
};
const handleSettings = (gameData: GameUpdate) => {
socket.emit('settings', { gameID, gameData });
};
@@ -114,6 +123,7 @@ export default function GamePage() {
position={layout[cardMap[index]]}
settings={settings}
flipAction={() => flipCard(cardMap[index])}
redrawAction={() => redraw(cardMap[index])}
/>
)}
</div>