-
Notifications
You must be signed in to change notification settings - Fork 334
feat: adds bot waypoint control to send certain units towards certain positions on the map #6589
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6589 +/- ##
============================================
- Coverage 29.05% 29.04% -0.02%
- Complexity 15171 15180 +9
============================================
Files 2837 2837
Lines 279215 279411 +196
Branches 49150 49188 +38
============================================
+ Hits 81129 81145 +16
- Misses 192749 192886 +137
- Partials 5337 5380 +43 ☔ View full report in Codecov by Sentry. |
|
|
||
| List<Coords> waypoints = new ArrayList<>(); | ||
|
|
||
| for (int i = 1; i < arguments.length; i++) { |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException Note
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.
I am willingly ignoring all the CodeQL errors on the ChatProcessor because as soon as this PR is merged I will start a PR that refactors the chat processor
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.
In this case we'd probably say "willfully", as in with full knowledge of the consequences and due to one's own decisions (with the implied connotation of "pridefully", "arrogantly"), as opposed to "willingly" 😄
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.
As weird as it may be, the phrase I wrote makes sense in my mother tongue LOL
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.
That was my assumption ^_^
|
|
||
| var splitPosition = hex.length() / 2; | ||
|
|
||
| int x = Integer.parseInt(hex.substring(0, splitPosition)) - 1; |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException Note
| var splitPosition = hex.length() / 2; | ||
|
|
||
| int x = Integer.parseInt(hex.substring(0, splitPosition)) - 1; | ||
| int y = Integer.parseInt(hex.substring(splitPosition)) - 1; |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException Note
| princess.getEntitiesOwned().stream().filter(entity -> entity.getId() == unitID).findFirst().ifPresent(entity -> { | ||
| var waypoint = princess.getUnitBehaviorTracker().removeHeadWaypoint(entity); | ||
| if (waypoint.isPresent()) { | ||
| var message = "Waypoint " + waypoint.get() + " removed from unit " + unitID; |
Check notice
Code scanning / CodeQL
Missing catch of NumberFormatException Note
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.
LGTM
What it does?
Adds functionality for bot to follow waypoints, you may add one waypoint, multiple waypoints forming a path, etc.
This PR adds this functionality, adds it to the bot chat commands and to the left map menu in the left click (of course, GM can command all bots). The command is specific for individual units, but there is one action that clear all waypoints.
Code QL complaining
I am willfully ignoring all the CodeQL errors on the ChatProcessor because as soon as this PR is merged I will start a PR that refactors the chat processor