Skip to content

Commit

Permalink
Code clean ups to AI code and another trace message. (#10430)
Browse files Browse the repository at this point in the history
Code clean ups to AI code and another trace message.
No logic changes, some performance improvements by avoiding unnecessary operations.

Tested using a full game (18 rounds) with all-hard-AI round on 1942 global 2nd ed to verify no crashes from removing collection copies.
  • Loading branch information
asvitkine authored May 12, 2022
1 parent ff87324 commit c971cce
Show file tree
Hide file tree
Showing 5 changed files with 273 additions and 336 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public AggregateResults calculate(
final int runCount) {
final double winPercentage =
ProBattleUtils.estimateStrengthDifference(
proData, location, new ArrayList<>(attackingUnits), new ArrayList<>(defendingUnits));
proData, location, attackingUnits, new ArrayList<>(defendingUnits));
List<Unit> remainingAttackingUnits = new ArrayList<>();
List<Unit> remainingDefendingUnits = new ArrayList<>();
if (winPercentage > 50) {
Expand Down
Loading

0 comments on commit c971cce

Please sign in to comment.