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

Implement RFE 6147: move infantry loading to interface and allow cargo bays #6627

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Sleet01
Copy link
Collaborator

@Sleet01 Sleet01 commented Feb 27, 2025

  1. Moves some data from InfantryBay.java into InfantryTransporter.java, a new Interface that should provide the minimum functionality for an Infantry-loading bay.
  2. Implement missing Infantry drop prerequisites to align with TW and SO rules.
  3. Remove restriction on number of infantry units dropped per turn, per SO rules.
  4. Add the ability to load Infantry units (but currently no others) to CargoBay.java
  5. Return ability to use Cargo Container bays to Fighter units (this had worked but was broken by the Mounted changes)
  6. Removed unused entity builders from AreaEffectHelperTest.java while adding them for CargoBayTest.java.

See https://discord.com/channels/458705327911731231/1344135419180351560 for rationale for some design decisions taken here.

Testing:

  • Many manual drops to confirm UI, space usage, and unit compatilibity.
  • Added unit tests for CargoBay class.
  • Ran all three projects' unit tests.

Merging this should unblock MegaMek/mekhq#5929

Close #6147

@Sleet01 Sleet01 requested a review from psikomonkie February 27, 2025 01:12
Copy link

codecov bot commented Feb 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.16%. Comparing base (b03a2d9) to head (0833748).
Report is 43 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##             master    #6627    +/-   ##
==========================================
  Coverage     29.15%   29.16%            
- Complexity    15415    15444    +29     
==========================================
  Files          2865     2871     +6     
  Lines        280027   280232   +205     
  Branches      49307    49335    +28     
==========================================
+ Hits          81655    81717    +62     
- Misses       192890   193030   +140     
- Partials       5482     5485     +3     

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

Copy link
Collaborator

@psikomonkie psikomonkie left a comment

Choose a reason for hiding this comment

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

Nice! I'm really excited for this. Code-wise everything looks great. Missing license file on CargoBayTest.java will need added, and I think the javadoc for InfantryTransporter.java was copied from Transporter.java - I was confused by it for a moment while reviewing, so maybe that should be looked at.

Thanks!

Comment on lines 19 to 25
/**
* Classes that implement this interface have the ability to load, carry, and
* unload units in the game. It is anticipated that classes will exist for
* passenger compartments, battle armor steps, Mek bays, Aerospace hangers, and
* vehicle garages. Other possible classes include cargo bays and Dropship
* docks.
*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be updated? I think even including a reference to Transporter (@see Transporter) would help someone unfamiliar with MM's transport system.

Copy link
Collaborator

Choose a reason for hiding this comment

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

License?

@psikomonkie
Copy link
Collaborator

There are a few more Transporters that are for transporting infantry, and I think the changes to MovementDisplay.java would prevent units from dropping out of these Transporters:

  • InfantryCompartment.java
  • BattleArmorBay.java

I don't think this should be implemented for the BA Handles even though those are for Transporting infantry, since this is specifically for infantry that are using their weight for loading.

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.

[RFE] Allow infantry to be carried in both infantry and cargo bays on vehicles
2 participants