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

Renamed 'Lances' to 'Strategic Formations', Expanded Functionality #5250

Merged
merged 8 commits into from
Nov 29, 2024

Conversation

IllianiCBT
Copy link
Collaborator

@IllianiCBT IllianiCBT commented Nov 25, 2024

Key Note: Lances are what MHQ called any combat Force, i.e. any combat node in your TO&E that contains at least one ground Unit. When reading the below any instance of 'lance' is referring to the internal class and not the IS Formation.

To reduce confusion Lance.java has been renamed to StrategicFormation.java. The relevant methods and classes have also been renamed.

A StratFor is considered to be any combat force in the TO&E that contains at least one ground unit and has no ancestor or descendant nodes which are also StratFors. Players can manually define individual forces to always be considered StratFors, or never considered StratFors. These overrides can be easily removed. Assigning or removing an override is accessed via the TO&E right-click menu.

StratFors are easily recognized by their bold nameplate. StratFors that have had their state overridden are also underlined.

A force that has had its StratFor status set to true will consider all units in that force, and all descendant forces, to be a part of that StratFor. This allows for deployment of entire companies at will (or greater).

The Briefing Room has been updated to consider units in descendant forces, when determining force weight. Weight is derived from a mean of all individual forces in the StratFor, ignoring empty forces.

StratCon and AtB will consider any StratFor fair game when picking seed forces, so players should be advised to try and keep their forces roughly equal, where possible.

StratCon will no longer consider non-combat forces as fair game for assignment to a track (manual or via integrated command rights), or scenario seeding.

Updated all references from `Lance` to `StrategicFormation` in multiple classes for clarity and better alignment with game terminology. This includes method names, variables, and comments to reflect the changes more accurately.
Renamed the `lances` variable to `strategicFormations` throughout the codebase for clarity. Added functionality to override strategic formation assignment and updated relevant logic to consider this override. Enhanced the strategic formation eligibility check and adjusted UI components to reflect these changes.
Consolidated text formatting into a single String based on formation status. Improved readability and maintainability by reducing repetitive code.
Removed an unnecessary log statement that printed the force name. Simplified the conditional check for reinforcement restrictions, ensuring better readability and maintainability.
@IllianiCBT IllianiCBT added the Force Generation Anything related to Force Generation (Opfor or Friendly) label Nov 25, 2024
@IllianiCBT IllianiCBT self-assigned this Nov 25, 2024
@IllianiCBT
Copy link
Collaborator Author

Closes #5200

@IllianiCBT IllianiCBT closed this Nov 25, 2024
@IllianiCBT
Copy link
Collaborator Author

Why do I keep doing that: reopening.

@IllianiCBT IllianiCBT reopened this Nov 25, 2024
MekHQ/src/mekhq/AtBGameThread.java Dismissed Show dismissed Hide dismissed
MekHQ/src/mekhq/campaign/Campaign.java Dismissed Show dismissed Hide dismissed
MekHQ/src/mekhq/campaign/force/StrategicFormation.java Dismissed Show dismissed Hide dismissed
Replaced '&' with '&' to properly encode HTML entities in comments. Additionally, renamed the 'c' parameter to 'campaign' for clarity and consistency.
Removed the redundant check for parent forces being strategic formations. This simplification improves code readability and potentially enhances performance by eliminating unnecessary iterations.
@codecov-commenter
Copy link

codecov-commenter commented Nov 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 10.47%. Comparing base (4c13b14) to head (d1b53f6).
Report is 44 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5250      +/-   ##
============================================
- Coverage     10.49%   10.47%   -0.03%     
  Complexity     6039     6039              
============================================
  Files           957      959       +2     
  Lines        134731   135067     +336     
  Branches      19577    19650      +73     
============================================
+ Hits          14140    14147       +7     
- Misses       119240   119569     +329     
  Partials       1351     1351              

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

Copy link
Member

@HammerGS HammerGS left a comment

Choose a reason for hiding this comment

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

Limited testing and GitHub Co-Pilot didn't identify any issues.

@HammerGS HammerGS merged commit 05578be into MegaMek:master Nov 29, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Force Generation Anything related to Force Generation (Opfor or Friendly)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants