971 B
971 B
title, status
| title | status |
|---|---|
| Fix Restart Game Action | Completed |
Objectives
- Fix the "Restart Game" button not actually resetting the game state fully (players were left with empty hands).
Diagnosis
- The
restartGamemethod inGameManagercorrectly reset the global state (turn, phase, step) and moved cards back to the library. - However, it failed to trigger the initial card draw (Mulligan phase start).
- This happened because
RulesEngine.startGame()(which handles the initial draw loop) was never called after the reset.
Fix Implemented
- Updated
GameManager.tsto instantiate a newRulesEngineand call.startGame()at the end ofrestartGame. - This ensures that after resetting variables, the engine immediately shuffles libraries and deals 7 cards to each player, effectively restarting the match.
Verification
- Clicking "Restart Game" now properly resets life totals, clears the board, and deals a fresh opening hand to all players.