Skip to content
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

Fix: Use all of the friendly units for support calculation in OOL #8000

Conversation

trevan
Copy link
Contributor

@trevan trevan commented Oct 30, 2020

If the targetsToPickFrom is a subgroup of all of the units on the other
side, then the support calculation will be incorrect. This could cause
the OOL to be calculated incorrectly.

An example would be submarines fighting air planes and other surface
ships. The submarines can't hit the air planes so the targetsToPickFrom
is just the surface ships. But the air planes might give support to the
surface ships and make some ships more valuable than normal.

Testing

Screens Shots

Additional Notes to Reviewer

Release Note

FIX|Default Order of Loss will now take into account support from all units in the battle, not just from the units that are currently being targeted. For example, in a battle where a submarine is fighting air units and other surface ships, the default order of loss was ignoring any support the air units could give to the surface ship.

If the targetsToPickFrom is a subgroup of all of the units on the other
side, then the support calculation will be incorrect.  This could cause
the OOL to be calculated incorrectly.

An example would be submarines fighting air planes and other surface
ships.  The submarines can't hit the air planes so the targetsToPickFrom
is just the surface ships.  But the air planes might give support to the
surface ships and make some ships more valuable than normal.
@codecov
Copy link

codecov bot commented Oct 30, 2020

Codecov Report

Merging #8000 into master will increase coverage by 0.00%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #8000   +/-   ##
=========================================
  Coverage     24.84%   24.84%           
+ Complexity     7288     7287    -1     
=========================================
  Files          1251     1251           
  Lines         79102    79104    +2     
  Branches      11162    11162           
=========================================
+ Hits          19653    19655    +2     
+ Misses        57356    57355    -1     
- Partials       2093     2094    +1     
Impacted Files Coverage Δ Complexity Δ
...elegate/battle/casualty/CasualtyOrderOfLosses.java 64.41% <0.00%> (-0.40%) 23.00 <0.00> (ø)
...lea/delegate/battle/casualty/CasualtySelector.java 51.12% <100.00%> (+0.37%) 15.00 <0.00> (ø)
.../java/games/strategy/triplea/delegate/Matches.java 44.84% <0.00%> (-0.11%) 372.00% <0.00%> (-1.00%)
...rc/main/java/games/strategy/net/nio/NioWriter.java 80.00% <0.00%> (+2.00%) 20.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 55abbef...63e26f0. Read the comment docs.

@DanVanAtta DanVanAtta merged commit a6f0360 into triplea-game:master Oct 31, 2020
@trevan trevan deleted the unify-supporting-units-in-casualty-selector branch October 31, 2020 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants