-
Notifications
You must be signed in to change notification settings - Fork 177
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
Refactored Strategic Formations #5268
Refactored Strategic Formations #5268
Conversation
Revised the strategic formation handling within the campaign code by introducing a centralized recalculation method to improve efficiency and consistency. Removed redundant checks and added sanitization for ineligible formations to maintain data integrity. This change also improved the logic for interacting with strategic formations, reducing duplicated code and enhancing readability.
Revised the `recalculateStrategicFormations` method to improve clarity and efficiency by adding separate sub-force calculations. Updated campaign processing to ensure strategic formation status is recalculated consistently. Integrated logging for better traceability of strategic formation eligibility and status updates.
Revised the method for recalculating strategic formations to optimize the handling of existing and new formations within a campaign. The update includes checking the eligibility of formations and adjusting the strategy status dynamically. Additionally, a method was added to remove non-eligible formations from the campaign's strategic structures.
Replaced several method names for better clarity and consistency, such as changing `importStrategicFormation` to `addStrategicFormation`. Updated calls to fetch and manipulate strategic formations with new methods, improving code readability and maintainability.
* @return the sanitized {@link Hashtable} of {@link StrategicFormation} objects stored in the | ||
* current campaign. | ||
*/ | ||
public Hashtable<Integer, StrategicFormation> getStrategicFormationsTable() { |
Check notice
Code scanning / CodeQL
Exposing internal representation Note
after this call to getStrategicFormationsTable
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5268 +/- ##
=========================================
Coverage 10.47% 10.47%
- Complexity 6039 6044 +5
=========================================
Files 959 959
Lines 135067 135115 +48
Branches 19650 19657 +7
=========================================
+ Hits 14147 14154 +7
- Misses 119569 119612 +43
+ Partials 1351 1349 -2 ☔ View full report in Codecov by Sentry. |
This PR does a bunch of refactoring for the new Strategic Formations system. It bolsters existing methods with a few extra calls and integrates better across MHQ. This includes self-sanitizing methods and a centralized way to review the TO&E to ensure it's always up-to-date. A number of bugs have been resolved and the general user experience has been improved.