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
Improve bombard and AA unit tooltip info #3361
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3361 +/- ##
============================================
+ Coverage 21.95% 22.89% +0.93%
- Complexity 5888 6634 +746
============================================
Files 832 833 +1
Lines 71877 75734 +3857
Branches 11588 13290 +1702
============================================
+ Hits 15781 17336 +1555
- Misses 54014 56167 +2153
- Partials 2082 2231 +149
Continue to review full report at Codecov.
|
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.
Just the one small comment, otherwise LGTM
} | ||
stats.append("with ").append(getMaxAaAttacks() != -1 ? getMaxAaAttacks() : "Unlimited").append(" Attacks for "); |
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.
On this condition: getMaxAaAttacks() != -1
I like the cleanup with ternary. The -1
becomes a magic number though, personally I'd like to see the method own the logic/knowledge of what is unlimited max attacks, eg something like getMaxAaAttacksHumanReadable()
(maybe not exactly that, but as an example to convey the point).
That seems like a bit much for right now though, especially with consideration that this part of the code owns all of the string logic so far. In that case I'd suggest to simply alleviate the magic number problem by converting:
!= -1
-> > -1
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.
Yeah, there are a lot of magic "-1" as its used to indicate unlimited or infinite for many parameters. I'm fine changing to ">" as I guess that helps a little bit.
Addressing some feedback from TWW thread like: https://forums.triplea-game.org/topic/493/total-world-war-december-1941-beta-2-8-0-4/222
Just changes the tooltip and unit help text to add more detail and improve format.
TWW BB and Sub Example: