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

Reputation Error Corrections & Report Reformatting #5216

Merged
merged 6 commits into from
Nov 23, 2024

Conversation

IllianiCBT
Copy link
Collaborator

CamOps Reputation now correctly calculates transport rating and command rating.

The CamOps Reputation report dialog has been reformatted to improve usability.

Going from this...
image

To this...
image

Closes #4652, #5194, #5193, #5205

Added checks to only increase the transportation rating if its current value is zero and the computed rating is greater than zero. This prevents unintended cumulative increases and maintains accurate ratings.
Revised the getSkillValue method to include skill bonus in the calculation. Added an intermediate variable to accumulate the skill level and bonus before returning the final skill value. This ensures a more accurate representation of the person's skill.
Replaced direct transportation value adjustments with capacity rating calculations. Added constants for different capacity states and a helper method to determine capacity ratings, improving code readability and maintainability.
Removed nested switch-case for DOUBLE_CAPACITY and merged it into the default case. This change reduces redundancy and clarifies the fallback logic in TransportationRating.
Enhanced the `getReportText` method with cleaner HTML table formatting and consolidated string operations. Removed unused and redundant private methods to streamline the code and improve maintainability.
@codecov-commenter
Copy link

codecov-commenter commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.51%. Comparing base (bce5f63) to head (090eec1).
Report is 29 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5216      +/-   ##
============================================
- Coverage     10.52%   10.51%   -0.01%     
- Complexity     6047     6048       +1     
============================================
  Files           957      957              
  Lines        134523   134589      +66     
  Branches      19545    19541       -4     
============================================
- Hits          14154    14152       -2     
- Misses       119018   119083      +65     
- Partials       1351     1354       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@JonhyBurner
Copy link

Wouldn't the extra transportation rating details fit better in the Transport Report (which could also benefit from a revamp)?

@IllianiCBT
Copy link
Collaborator Author

This report is specifically all the elements that go into CamOps Reputation. Splitting that across multiple reports wouldn’t be a good move imo.

As for revamping the other reports, I only did CamOps Reputation because we absolutely needed it updated under the hood for the move from FM:Mr. I have no interest in touching the other reports give this report alone has took a week+ of dev time.

@IllianiCBT
Copy link
Collaborator Author

Updated to include commander

image image

Closes #5237

Updated `ReputationController` to include the flagged commander's name in the generated reputation report. Added relevant resource strings to the properties file for localization.
@HammerGS HammerGS merged commit dcfb52a into MegaMek:master Nov 23, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFE: Formatting & disambiguation notes for CamOps unit reputation report.
4 participants