Skip to content

update OnSelectIdleCmd - #261

Draft
mercury233 wants to merge 1 commit into
masterfrom
patch-idle-cmd
Draft

update OnSelectIdleCmd#261
mercury233 wants to merge 1 commit into
masterfrom
patch-idle-cmd

Conversation

@mercury233

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds validation and fallback handling for main-phase idle commands.

Changes:

  • Adds the protocol’s shuffle action.
  • Validates AI responses against available commands.
  • Handles unavailable battle/end-phase transitions.

The validation is useful, but the shuffle-first fallback can repeatedly re-enter idle selection.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
Game/MainPhaseAction.cs Adds shuffle action encoding.
Game/GameBehavior.cs Validates responses and selects fallbacks.
Game/GameAI.cs Exposes selection clearing and improves phase fallback.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Game/GameBehavior.cs
Comment on lines +1577 to +1589
else if (canShuffle)
action = new MainPhaseAction(MainPhaseAction.MainAction.Shuffle);
else
{
for (int actionType = 0; actionType < actionCounts.Length; ++actionType)
{
if (actionCounts[actionType] > 0)
{
action = new MainPhaseAction((MainPhaseAction.MainAction)actionType, 0);
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants