-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add action_params(StopFlyingWaitTime) to stop_flying #1277
Conversation
fix: ensure next step only proceeds after stop_flying.
似乎由于 WaypointForTrack 强制要求 action_param 是字符串类型,所以 json 文件中要写成字符串。 |
BetterGenshinImpact/GameTask/AutoPathing/Model/WaypointForTrack.cs
Outdated
Show resolved
Hide resolved
BetterGenshinImpact/GameTask/AutoPathing/Model/WaypointForTrack.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new action parameter "StopFlyingWaitTime" for the stop_flying action by adding a dedicated StopFlyingHandler and updating the corresponding call in PathExecutor to ensure that the next step only proceeds after stopping flying. Key changes include:
- Adding a new StopFlyingHandler to process the stop_flying action using the provided wait time.
- Updating PathExecutor to delegate the stop_flying action to the new handler.
- Minor cleanup by removing an unused import in WaypointForTrack and updating the ActionFactory mapping.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
BetterGenshinImpact/GameTask/AutoPathing/Handler/StopFlyingHandler.cs | New handler implementation that uses the ActionParams for stop_flying wait time. |
BetterGenshinImpact/GameTask/AutoPathing/PathExecutor.cs | Refactored inline stop_flying behavior to delegate to StopFlyingHandler. |
BetterGenshinImpact/GameTask/AutoPathing/Model/WaypointForTrack.cs | Removed unused import to clean up the file. |
BetterGenshinImpact/GameTask/AutoPathing/Handler/ActionFactory.cs | Updated mapping to include the new stop_flying handler. |
Comments suppressed due to low confidence (1)
BetterGenshinImpact/GameTask/AutoPathing/Handler/StopFlyingHandler.cs:26
- [nitpick] Consider renaming variable 'i' to a more descriptive name like 'attemptCount' to improve readability.
int i;
BetterGenshinImpact/GameTask/AutoPathing/Handler/StopFlyingHandler.cs
Outdated
Show resolved
Hide resolved
测试之后没什么问题,等待时间的单位变成了毫秒,我修改一下测试用例。 |
顺便一提,AI提供的建议是正确的,建议使用 int.TryParse。 非UI界面的,大部分应该用毫秒,尤其是这种飞行时间基本都需要到毫秒级。浮点数有坑 |
测试用例: