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
Add unit option for when hit points damaged changes into #2689
Add unit option for when hit points damaged changes into #2689
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2689 +/- ##
===========================================
+ Coverage 20.2% 20.2% +<.01%
- Complexity 5759 5763 +4
===========================================
Files 816 816
Lines 73766 73813 +47
Branches 12312 12319 +7
===========================================
+ Hits 14905 14916 +11
- Misses 56725 56757 +32
- Partials 2136 2140 +4
Continue to review full report at Codecov.
|
} | ||
|
||
public void resetWhenHitPointsDamagedChangesInto() { | ||
m_whenHitPointsDamagedChangesInto = new LinkedHashMap<>(); |
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.
This method uses LinkedHashMap
, but the field initializer uses HashMap
. Was that intentional?
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.
Fixed.
* Can remove null check and this comment for next incompatible release. | ||
*/ | ||
public Map<Integer, Tuple<Boolean, UnitType>> getWhenHitPointsDamagedChangesInto() { | ||
if (m_whenHitPointsDamagedChangesInto == null) { |
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.
Do you need a similar null
check in clearWhenHitPointsDamagedChangesInto()
and setWhenHitPointsDamagedChangesInto(String)
? Or will those code paths not be hit after deserializing an old save game?
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.
Fairly sure those shouldn't be hit.
Addresses the first part of feature request: https://forums.triplea-game.org/topic/327/unit-option-when-damaged-change-into-different-unit-weakened-battleships
Functional Changes
Tested
Example XML