@@ -6,7 +6,7 @@ import { GameInfoPanel } from '../../../components/games/GameInfoPanel'
66import { GameContainer , GameControls , ConfirmationModal } from '../../../components/ui'
77import { MCPAssistantPanel } from '../../../components/shared'
88import type { RPSGameState , RPSMove } from '@turn-based-mcp/shared'
9- import type { GameSession } from '@turn-based-mcp/shared'
9+ import type { GameSession , Difficulty } from '@turn-based-mcp/shared'
1010
1111export default function RockPaperScissorsPage ( ) {
1212 const [ gameSession , setGameSession ] = useState < GameSession < RPSGameState > | null > ( null )
@@ -16,7 +16,8 @@ export default function RockPaperScissorsPage() {
1616 const [ availableGames , setAvailableGames ] = useState < GameSession < RPSGameState > [ ] > ( [ ] )
1717 const [ showCreateForm , setShowCreateForm ] = useState ( false )
1818 const [ showJoinForm , setShowJoinForm ] = useState ( false )
19- const [ aiDifficulty , setAiDifficulty ] = useState < 'easy' | 'medium' | 'hard' > ( 'medium' )
19+ const [ aiDifficulty , setAiDifficulty ] = useState < Difficulty > ( 'medium' )
20+ const [ maxRounds , setMaxRounds ] = useState < number > ( 3 )
2021 const [ gamesToShow , setGamesToShow ] = useState ( 5 )
2122 const [ showDeleteModal , setShowDeleteModal ] = useState ( false )
2223 const [ gameToDelete , setGameToDelete ] = useState < string | null > ( null )
@@ -79,9 +80,10 @@ export default function RockPaperScissorsPage() {
7980 setError ( null )
8081
8182 try {
82- const body : { playerName : string ; gameId ?: string ; aiDifficulty : string } = {
83+ const body : { playerName : string ; gameId ?: string ; aiDifficulty : string ; maxRounds : number } = {
8384 playerName : 'Player' ,
84- aiDifficulty
85+ aiDifficulty,
86+ maxRounds
8587 }
8688 if ( customGameId ) {
8789 body . gameId = customGameId
@@ -280,7 +282,7 @@ export default function RockPaperScissorsPage() {
280282 < >
281283 < GameContainer
282284 title = "Rock Paper Scissors"
283- description = "Best of 3 rounds! Rock beats Scissors, Scissors beats Paper, Paper beats Rock."
285+ description = { `Play ${ gameSession . gameState . maxRounds } round ${ gameSession . gameState . maxRounds !== 1 ? 's' : '' } ! Rock beats Scissors, Scissors beats Paper, Paper beats Rock.` }
284286 gameBoard = { gameBoard }
285287 sidebar = { sidebar }
286288 error = { error }
@@ -439,6 +441,22 @@ export default function RockPaperScissorsPage() {
439441 < option value = "hard" > 🔴 Hard - Advanced pattern recognition</ option >
440442 </ select >
441443 </ div >
444+ < div >
445+ < label className = "block text-sm font-semibold text-slate-700 dark:text-slate-300 mb-2" >
446+ Number of Rounds
447+ </ label >
448+ < select
449+ value = { maxRounds }
450+ onChange = { ( e ) => setMaxRounds ( parseInt ( e . target . value ) ) }
451+ className = "w-full px-4 py-3 bg-white/60 dark:bg-slate-700/60 border border-slate-200 dark:border-slate-600 rounded-xl focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent transition-all duration-200"
452+ >
453+ < option value = { 1 } > 1 Round</ option >
454+ < option value = { 3 } > 3 Rounds (Best of 3)</ option >
455+ < option value = { 5 } > 5 Rounds (Best of 5)</ option >
456+ < option value = { 7 } > 7 Rounds (Best of 7)</ option >
457+ < option value = { 10 } > 10 Rounds</ option >
458+ </ select >
459+ </ div >
442460 < div >
443461 < label className = "block text-sm font-semibold text-slate-700 dark:text-slate-300 mb-2" >
444462 Custom Game ID (optional)
@@ -534,7 +552,7 @@ export default function RockPaperScissorsPage() {
534552 < >
535553 < GameContainer
536554 title = "Rock Paper Scissors"
537- description = "Best of 3 rounds! Rock beats Scissors, Scissors beats Paper, Paper beats Rock."
555+ description = { `Play ${ maxRounds } round ${ maxRounds !== 1 ? 's' : '' } ! Rock beats Scissors, Scissors beats Paper, Paper beats Rock.` }
538556 gameBoard = { gameSetupContent }
539557 sidebar = { < div > </ div > } // Empty sidebar for setup
540558 error = { error }
0 commit comments