Add bot participation in deal phase with requests #66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enables bots to participate in the deal phase of the Tractor card game. Each time a card is dealt to a bot player, a request is sent to the bot service to get the bot's decision on whether to declare trump (亮主) or counter-bid (反主).
Changes Made
Modified
DrawingPhaseManager.jsto enable bot participation in the deal phase:triggerBotDealAction(player, card, playerIndex)- After each card is dealt to a bot, this method calls the bot service to get the bot's decision on whether to declare trump or counter-bid.parseBotDealCards(selectedCards)- Parses the bot's selected cards to determine the trump suit and count (single or pair). Supports joker pair declarations for no-trump.executeBotTrumpDeclaration(player, suit, count, selectedCards)- Validates and executes the bot's trump declaration, broadcasting the result to all players and resetting the dealer countdown timer when appropriate.Implementation Details
The implementation:
BotService.getBotDealAction()methodvalidateDeclarationutilitytrump_declaredandtrump_updatedevents to all clientsOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.