8000 Improvement: Made Planetary Acquisition Verbose Mode Even More Verbose by savanik · Pull Request #6840 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Improvement: Made Planetary Acquisition Verbose Mode Even More Verbose #6840

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

Merged
merged 1 commit into from
May 2, 2025

Conversation

savanik
Copy link
Contributor
@savanik savanik commented May 2, 2025

Added visibility for the target numbers and modifiers going into Planetary Acquisition verbose mode.

@HammerGS HammerGS requested a review from Copilot May 2, 2025 03:28
Copy link
Contributor
@Copilot Copilot AI left a 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 pull request increases the verbosity of Planetary Acquisition output by including target numbers and detailed modifier information, and refactors the maintenance method call for improved readability.

  • Added detailed bonus outputs (Tech, Industry, and Outputs) to the verbose messages in the acquisition methods.
  • Reformatted the call to doMaintenanceOnUnitPart to improve code clarity.

@@ -3884,7 +3889,18 @@ public PartAcquisitionResult findContactForAcquisition(IAcquisitionWork acquisit
acquisition.getAcquisitionName() +
" on " +
system.getPrintableName(getLocalDate()) +
"</b></font>");
" at TN: " +
Copy link
Preview
Copilot AI May 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider using String.format or a similar approach to build the verbose message, improving readability and maintainability of the string construction.

Copilot uses AI. Check for mistakes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not strictly relevant. Can be ignored.

@@ -3874,6 +3874,11 @@ public PartAcquisitionResult findContactForAcquisition(IAcquisitionWork acquisit
}
return PartAcquisitionResult.PlanetSpecificFailure;
}
SocioIndustrialData socioIndustrial = system.getPrimaryPlanet().getSocioIndustrial(getLocalDate());
Copy link
Preview
Copilot AI May 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider extracting the verbose string construction logic into a dedicated helper method to reduce duplication across both branches.

Copilot uses AI. Check for mistakes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not strictly relevant. Can be ignored.

Copy link
Collaborator
@IllianiBird IllianiBird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good :)

(tech > 0 ? "+" : "") +
tech +
", Industry: " +
(industry > 0 ? "+" : "") +
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So one small comment, external to the review. If you were writing this method fresh we'd ask you to use a resource bundle. In the event that wasn't possible you'd absolutely want to use a StringBuilder here, instead of just gluing 101 strings together.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I 100% would use String Builder here.

@IllianiBird IllianiBird changed the title Makes Planetary Acquisition verbose mode much more verbose. Improvement: Makes Planetary Acquisition Verbose Mode Even More Verbose May 2, 2025
@IllianiBird IllianiBird changed the title Improvement: Makes Planetary Acquisition Verbose Mode Even More Verbose Improvement: Made Planetary Acquisition Verbose Mode Even More Verbose May 2, 2025
Copy link
codecov bot commented May 2, 2025

Codecov Report

Attention: Patch coverage is 0% with 17 lines in your changes missing coverage. Please review.

Project coverage is 11.44%. Comparing base (c73a91d) to head (76d12db).
Report is 302 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6840      +/-   ##
============================================
+ Coverage     11.41%   11.44%   +0.03%     
- Complexity     6479     6498      +19     
============================================
  Files          1095     1099       +4     
  Lines        140820   140911      +91     
  Branches      21813    21844      +31     
============================================
+ Hits          16069    16126      +57     
- Misses       123089   123117      +28     
- Partials       1662     1668       +6     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Files with missing lines Patch % Lines
MekHQ/src/mekhq/campaign/Campaign.java 0.00% 17 Missing ⚠️

@Scoppio Scoppio merged commit b444681 into MegaMek:master May 2, 2025
6 checks passed
@savanik savanik deleted the moreVerbosePlanetaryAcquisition branch May 20, 2025 16:05
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.

3 participants
0