-
Notifications
You must be signed in to change notification settings - Fork 191
Fix for Unit Sale Costs being generally incorrect - Mekhq part #6868
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6868 +/- ##
============================================
+ Coverage 11.41% 11.51% +0.10%
- Complexity 6479 6564 +85
============================================
Files 1095 1100 +5
Lines 140820 140977 +157
Branches 21813 21845 +32
============================================
+ Hits 16069 16238 +169
+ Misses 123089 123046 -43
- Partials 1662 1693 +31 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Updated the commit comments to properly reflect what was being updated. No other 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.
Pull Request Overview
This PR fixes the calculation issues related to unit sale costs in TankLocation by updating functions to compute internal location costs more accurately.
- Reformatted the TechAdvancement chain for better readability.
- Updated the isSamePartType and details methods with cleaner formatting.
- Implemented new logic in getTonnage and getStickerPrice to reflect internal structure and controls costs.
structureCost += 10000 * getTonnage(); // True for SVs as well? | ||
controlsCost += 10000 * getTonnage() / 2; |
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.
[nitpick] Consider caching the result of getTonnage() into a local variable if its computation becomes non-trivial to avoid redundant calls and improve maintainability.
structureCost += 10000 * getTonnage(); // True for SVs as well? | |
controlsCost += 10000 * getTonnage() / 2; | |
double tonnage = getTonnage(); | |
structureCost += 10000 * tonnage; // True for SVs as well? | |
controlsCost += 10000 * tonnage / 2; |
Copilot uses AI. Check for mistakes.
// Cannot have endo steel etc. | ||
// Turrets are handled separately | ||
double tonnage = getUnitTonnage() * 0.1 / 4; | ||
return (tonnage); |
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.
[nitpick] The parentheses around the 'tonnage' variable in the return statement are unnecessary. Consider simplifying the code to 'return tonnage;'.
return (tonnage); | |
return tonnage; |
Copilot uses AI. Check for mistakes.
Updated functions in TankLocation.java to correct sale price. Location costs now calculate for internal structure / controls. Still needs updates for chassis costs per support vehicles in Tech Manual p280, maybe?