1.4 KiB
1.4 KiB
Game Config Persistence
Purpose
Ensures table setup configuration is persisted and restored when the game page loads, so user preferences from /setup are applied to the game session.
Requirements
Requirement: Game reads setup config from sessionStorage
When the game page loads, it SHALL read the configuration stored in sessionStorage under the key poker-config and apply those settings to initialize the game state.
Scenario: Config exists in sessionStorage
- WHEN a user navigates from
/setupafter configuring their table - THEN the game page reads
sessionStorage.getItem('poker-config')and uses the parsed values to create the initial game state
Scenario: No config exists (first visit)
- WHEN a user navigates directly to
/without visiting/setup - THEN the game falls back to the default
trainingMixpreset
Requirement: All setup parameters are applied
The parsed configuration SHALL include values for numPlayers, startingStack, smallBlind, bigBlind, infoLevel, feedbackLevel, timerEnabled, timerDuration, humanTimerMode, and humanTimerDuration.
Scenario: Custom settings are preserved
- WHEN a user sets small blind to 50, big blind to 100, and starting stack to 5000
- THEN the initialized game state reflects those exact values in
smallBlind,bigBlind, and player chip counts