-
Notifications
You must be signed in to change notification settings - Fork 396
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
Ai add land transports #3439
Ai add land transports #3439
Conversation
|
||
// Set air units in any territory with no AA (don't move planes to empty territories) | ||
for (final Iterator<Unit> it = sortedUnitAttackOptions.keySet().iterator(); it.hasNext();) { | ||
final Unit unit = it.next(); | ||
for (final Unit unit : sortedUnitAttackOptions.keySet()) { |
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.
Had to move away from iterator since there is potential to have to remove multiple units now.
@@ -95,27 +99,7 @@ public static int findMaxMovementForTransports(final List<ProPurchaseOption> sea | |||
units.removeAll(unitsToIgnore); | |||
|
|||
// Sort units by attack | |||
units.sort((o1, o2) -> { |
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.
Moved to a separate method.
Codecov Report
@@ Coverage Diff @@
## master #3439 +/- ##
============================================
- Coverage 22% 21.99% -0.02%
- Complexity 5912 5914 +2
============================================
Files 832 832
Lines 71853 71912 +59
Branches 11575 11583 +8
============================================
+ Hits 15813 15816 +3
- Misses 53953 54011 +58
+ Partials 2087 2085 -2
Continue to review full report at Codecov.
|
Gonna look to merge this in the next day or so since its AI only changes. |
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.
Had a quick glance at the code.
Looks good, I like that you extracter some utility methods, it would be great to have a couple of tests for them
Add AI support for moving units with land transports. Here is a 27 round test game on Iron War showing the AI moving them and not having any errors:
1527297106541-ironwarai.zip