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

@@ -130,6 +130,19 @@ export default class GameStore {
return this.gameUpdate(game);
}
redraw(gameID: string, cardIndex: number): GameUpdate {
const game = this.getGame(gameID);
const card = game.cards[cardIndex];
if (!card) throw new Error(`Card ${cardIndex} not found`);
game.cards[cardIndex] =
card.suit === 'High Deck' ? deck.drawHigh(game.cards) : deck.drawLow(game.cards);
game.lastUpdated = Date.now();
return this.gameUpdate(game);
}
updateSettings(gameID: string, settings: Settings) {
const game = this.getGame(gameID);