Skip to content

Improvement: Added Optional Tracking of MASH Theatres#7807

Merged
HammerGS merged 8 commits into
MegaMek:mainfrom
IllianiBird:mashTheatres
Oct 26, 2025
Merged

Improvement: Added Optional Tracking of MASH Theatres#7807
HammerGS merged 8 commits into
MegaMek:mainfrom
IllianiBird:mashTheatres

Conversation

@IllianiBird

Copy link
Copy Markdown
Collaborator

With this PR we've added a campaign option that allows for the tracking of MASH Theatres in a players' TO&E.

If enabled, the maximum number of patients a campaign can support - across all doctors - is capped by the campaign's MASH Theatre capacity. The capacity of threatres defaults to 25, but can be changed in campaign options.

@IllianiBird IllianiBird self-assigned this Oct 23, 2025
@IllianiBird IllianiBird requested a review from a team as a code owner October 23, 2025 04:15
@IllianiBird IllianiBird added Campaign Options Relates to, or includes, campaign option changes Implementation of Missing Official Rule Used with the RFE tag for the implementation of missing official rule labels Oct 23, 2025
Comment on lines +2225 to +2227
public void setFieldKitchenWithinCapacity(boolean fieldKitchenWithinCapacity) {
this.fieldKitchenWithinCapacity = fieldKitchenWithinCapacity;
}

@IllianiBird IllianiBird Oct 23, 2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I spotted we weren't saving this data for some odd reason lost to time. So while I was in this neck of the woods I added saving. Nominally this would have caused only minor issues as the data is refreshed on new day.

@codecov

codecov Bot commented Oct 23, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 3.25203% with 119 lines in your changes missing coverage. Please review.
✅ Project coverage is 12.13%. Comparing base (f394455) to head (a2bb007).
⚠️ Report is 134 commits behind head on main.

Files with missing lines Patch % Lines
...khq/gui/campaignOptions/contents/PersonnelTab.java 0.00% 22 Missing ⚠️
MekHQ/src/mekhq/gui/InfirmaryTab.java 0.00% 19 Missing ⚠️
MekHQ/src/mekhq/campaign/Campaign.java 5.26% 18 Missing ⚠️
MekHQ/src/mekhq/campaign/CampaignSummary.java 0.00% 14 Missing ⚠️
...mekhq/campaign/personnel/medical/MASHCapacity.java 0.00% 14 Missing ⚠️
.../campaign/personnel/medical/MedicalController.java 0.00% 9 Missing ⚠️
...c/mekhq/campaign/OptimizeInfirmaryAssignments.java 0.00% 6 Missing ⚠️
...ekhq/campaign/campaignOptions/CampaignOptions.java 37.50% 5 Missing ⚠️
MekHQ/src/mekhq/campaign/io/CampaignXmlParser.java 0.00% 4 Missing ⚠️
...src/mekhq/gui/dialog/nagDialogs/NagController.java 0.00% 3 Missing ⚠️
... and 3 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7807      +/-   ##
============================================
- Coverage     12.14%   12.13%   -0.01%     
  Complexity     7352     7352              
============================================
  Files          1214     1215       +1     
  Lines        153291   153457     +166     
  Branches      23200    23228      +28     
============================================
+ Hits          18610    18617       +7     
- Misses       132753   132908     +155     
- Partials       1928     1932       +4     

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

@HammerGS HammerGS requested a review from Copilot October 23, 2025 20:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 introduces optional tracking of MASH (Mobile Army Surgical Hospital) Theatres in the campaign's TO&E, allowing players to cap the maximum number of concurrent patients based on available MASH Theatre-equipped units rather than solely on doctor capacity.

Key changes:

  • Added campaign options to enable MASH Theatre tracking and configure capacity per theatre (default: 25 patients)
  • MASH Theatre capacity now acts as an upper limit on total patients across all doctors when enabled
  • Updated UI components to display MASH Theatre capacity alongside hospital bed information

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
MASHCapacity.java New utility class to calculate total MASH Theatre capacity from eligible units
CampaignOptions.java Added fields and getters/setters for MASH Theatre tracking options
Campaign.java Added capacity tracking fields, daily update logic, and capacity checking methods
PersonnelTab.java Added UI controls for configuring MASH Theatre options
InfirmaryTab.java Updated doctor assignment logic to respect MASH Theatre capacity limits
OptimizeInfirmaryAssignments.java Modified assignment algorithm to honor global MASH Theatre capacity
MedicalController.java Added verification to unassign patients when theatre capacity is exceeded
CampaignSummary.java Updated facility report to display MASH Theatre capacity information
NagController.java Modified to pass MASH Theatre capacity to untreated personnel checks
UntreatedPersonnelNagDialog.java Updated to consider MASH Theatre capacity in nag calculations
CampaignXmlParser.java Added XML parsing for persisting MASH Theatre capacity state
CampaignOptionsMarshaller.java Added XML serialization for MASH Theatre options
CampaignOptionsUnmarshaller.java Added XML deserialization for MASH Theatre options
CampaignOptionsDialog.properties Added UI labels and tooltips for MASH Theatre configuration
MedicalController.properties Added error message for exceeding theatre capacity
GlossaryEntry.properties Updated Hospital Beds glossary entry to document MASH Theatre feature
TutorialHyperlinkPanel.properties Updated tutorial links to reference MASH Theatres

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread MekHQ/src/mekhq/campaign/io/CampaignXmlParser.java Outdated
Comment thread MekHQ/src/mekhq/gui/InfirmaryTab.java
Comment thread MekHQ/src/mekhq/gui/InfirmaryTab.java
Comment thread MekHQ/src/mekhq/campaign/CampaignSummary.java
@HammerGS HammerGS merged commit 1f8e32b into MegaMek:main Oct 26, 2025
7 checks passed
@IllianiBird IllianiBird deleted the mashTheatres branch November 13, 2025 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Campaign Options Relates to, or includes, campaign option changes Implementation of Missing Official Rule Used with the RFE tag for the implementation of missing official rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants