8000 PR: Moved SPA Info in Preparation for Future Changes by IllianiBird · Pull Request #6820 · MegaMek/mekhq · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

PR: Moved SPA Info in Preparation for Future Changes #6820

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 3 commits into from
May 1, 2025

Conversation

IllianiBird
Copy link
Collaborator
@IllianiBird IllianiBird commented Apr 29, 2025

Dev Notes

I'm about to move some logic out of AbilitiesTab.java connected to the categorization of SPAs. This will allow that logic to be used anywhere, not just campaign options. However, to do that I needed to move the enum values out of CampaignOptionsAbilityInfo.java. I was advised to make a PR that just did the move and renaming, and then to follow up with the logic changes.

### Dev Notes
I'm about to move some logic out of `AbilitiesTab.java` connected to the categorization of SPAs. This will allow that logic to be used anywhere, not just campaign options. However, to do that I needed to move and rename `CampaignOptionsAbilityInfo.java`. I was advised to make a PR that just did the move and renaming, and then to follow up with the logic changes.
Copy link
codecov bot commented Apr 29, 2025

Codecov Report

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

Project coverage is 11.46%. Comparing base (6e08f00) to head (a2ed384).
Report is 40 commits behind head on master.

Files with missing lines Patch % Lines
.../utilities/spaUtilities/enums/AbilityCategory.java 0.00% 2 Missing ⚠️
...ui/campaignOptions/CampaignOptionsAbilityInfo.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6820      +/-   ##
============================================
+ Coverage     11.45%   11.46%   +0.01%     
- Complexity     6499     6502       +3     
============================================
  Files          1098     1099       +1     
  Lines        140854   140807      -47     
  Branches      21841    21829      -12     
============================================
+ Hits          16130    16139       +9     
+ Misses       123050   123002      -48     
+ Partials       1674     1666       -8     

☔ 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.

@IllianiBird IllianiBird reopened this Apr 29, 2025
@IllianiBird IllianiBird changed the title Moved SPA Info in Preparation for Future Changes PR: Moved SPA Info in Preparation for Future Changes Apr 30, 2025
@Scoppio Scoppio requested a review from Copilot May 1, 2025 01:34
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 PR moves the SPA-related AbilityCategory enum into a new location (mekhq.utilities.spaUtilities.enums) to prepare for future logic changes by separating out the categorization logic from CampaignOptionsAbilityInfo. Key changes include:

  • Creating a new AbilityCategory enum in a utilities package.
  • Updating AbilitiesTab.java and CampaignOptionsPane.java to import the enum from its new location.
  • Removing the nested AbilityCategory enum from CampaignOptionsAbilityInfo.java.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
MekHQ/src/mekhq/utilities/spaUtilities/enums/AbilityCategory.java New file containing the AbilityCategory enum.
MekHQ/src/mekhq/gui/campaignOptions/contents/AbilitiesTab.java Updated imports to reference the new AbilityCategory and removed unused imports.
MekHQ/src/mekhq/gui/campaignOptions/CampaignOptionsPane.java Updated static imports to reference the new AbilityCategory enum.
MekHQ/src/mekhq/gui/campaignOptions/CampaignOptionsAbilityInfo.java Removed the nested AbilityCategory enum in favor of using the imported enum.

Comment on lines +82 to 83
import mekhq.utilities.spaUtilities.enums.AbilityCategory;

Copy link
Preview
Copilot AI May 1, 2025

Choose a reason for hiding this comment

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

[nitpick] The non-static import of AbilityCategory may be redundant given that its individual constants are already imported statically. Consider removing it if the raw type reference is not required.

Suggested change
import mekhq.utilities.spaUtilities.enums.AbilityCategory;

Copilot uses AI. Check for mistakes.

Copy link
Collaborator
@Scoppio Scoppio left a comment

Choose a reason for hiding this comment

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

I suggest to avoid doing just the static import of enum values once the class is moved to another places.

@Scoppio Scoppio merged commit df11e1f into MegaMek:master May 1, 2025
6 checks passed
@IllianiBird IllianiBird deleted the moveAbilityInfo branch June 7, 2025 22:01
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.

2 participants
0