Move Round and Phase Handling into Message Processors#53
Merged
Conversation
Contributor
📝 WalkthroughWalkthrough本次变更将回合与阶段的界面、副作用及战法状态处理移至对应消息处理器,简化 Changes回合与阶段生命周期
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant MsgGameTurnNtf
participant Game
participant Laya
participant tracker
MsgGameTurnNtf->>Game: validate TurnCnt and setTurn(TurnCnt)
MsgGameTurnNtf->>Laya: resetTurnZhanFa()
MsgGameTurnNtf->>tracker: scheduleTrackerRender()
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/handler/MsgGameTurnNtf.js`:
- Line 12: 更新 MsgGameTurnNtf 中对 TurnCnt 的校验,仅允许非负整数,拒绝负数和小数后再调用
Game.setTurn;同时为这些无效输入补充对应测试,确保不会触发轮次状态更新或渲染。
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 64b72fc4-4c4f-4fa4-a8a5-dbd78ef779a0
📒 Files selected for processing (9)
docs/agents/card_tracker.mddocs/agents/lifecycle.mdsrc/handler/GsCGamephaseNtf.jssrc/handler/MsgGameTurnNtf.jssrc/tracker/Game.tssrc/tracker/gameState.tstests/tracker/gamePhase.test.tstests/tracker/gameTurn.test.tstests/tracker/room.import.test.ts
💤 Files with no reviewable changes (2)
- src/tracker/Game.ts
- src/tracker/gameState.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary by CodeRabbit
功能优化
测试
文档