-
Notifications
You must be signed in to change notification settings - Fork 188
Refactored Medical Systems #6707
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
Conversation
- Moved `InjuryTypes`, `InjuryUtil`, and related advanced medical files to a new package: `mekhq.campaign.personnel.medical.advancedMedical`. - Centralized medical logic into a new `MedicalController` class. Moving it out of `Campaign.java`. - Removed logic checks for impossible healing rolls that are no longer valid due to centralization. - Prevented unintentional doctor reassignments with strengthened validation.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6707 +/- ##
============================================
+ Coverage 11.44% 11.45% +0.01%
- Complexity 6479 6501 +22
============================================
Files 1094 1098 +4
Lines 140666 140870 +204
Branches 21808 21843 +35
============================================
+ Hits 16095 16135 +40
- Misses 122916 123061 +145
- Partials 1655 1674 +19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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 centralizes medical logic by introducing a new MedicalController, moves advanced medical classes to a dedicated package, and updates related functionality (including skill checks and healing roll computations) throughout the codebase.
- Centralized medical healing and doctor assignment logic into MedicalController.
- Moved InjuryTypes, InjuryUtil, and related files to a new advanced medical package.
- Updated SkillCheckUtility integration and adjusted corresponding test cases.
Reviewed Changes
Copilot reviewed 18 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
MekHQ/unittests/mekhq/campaign/personnel/skills/SkillCheckUtilityTest.java | Updated test cases to reflect new SkillCheckUtility API and TargetRoll usage. |
MekHQ/src/mekhq/gui/dialog/SkillCheckDialog.java | Modified SkillCheckUtility constructor parameters and added reporting. |
MekHQ/src/mekhq/gui/dialog/ReplacementLimbDialog.java | Updated import paths for advanced medical InjuryTypes. |
MekHQ/src/mekhq/gui/dialog/DataLoadingDialog.java | Corrected imports for InjuryTypes and removed redundant SkillType import. |
MekHQ/src/mekhq/gui/adapter/PersonnelTableMouseAdapter.java | Updated multiple import statements to point to advanced medical package. |
MekHQ/src/mekhq/gui/InfirmaryTab.java | Removed obsolete impossible healing roll check to align with centralized logic. |
MekHQ/src/mekhq/campaign/personnel/skills/Attributes.java | Enhanced getters by clamping attribute values within defined bounds. |
MekHQ/src/mekhq/campaign/personnel/medical/advancedMedical/* | Moved files to the new package structure for advanced medical handling. |
MekHQ/src/mekhq/campaign/medical/MedicalController.java | Introduced centralized medical event processing and healing logic. |
MekHQ/src/mekhq/campaign/Person.java | Adjusted healing mod retrieval to align with new TargetRollModifier usage. |
MekHQ/src/mekhq/campaign/Campaign.java | Removed legacy advanced medical event processing in favor of MedicalController. |
Others | Various import and package updates to support the refactor. |
Files not reviewed (2)
- MekHQ/resources/mekhq/resources/MedicalController.properties: Language not supported
- MekHQ/resources/mekhq/resources/SkillCheckUtility.properties: Language not supported
Comments suppressed due to low confidence (1)
MekHQ/unittests/mekhq/campaign/personnel/skills/SkillCheckUtilityTest.java:262
- The expected total attribute score for two linked attributes has changed sign (from a positive to a negative value). Please verify that this update accurately reflects the intended calculation and doesn’t introduce an error in the healing or skill check logic.
assertEquals(-14, targetNumber.getValue(), targetNumber.toString());
…hroughout `EventEffectsManager` to ensure proper event propagation after modifications to person objects.
MedicalController
class. Moving it out ofCampaign.java
.InjuryTypes
,InjuryUtil
, and related advanced medical files to a new package:mekhq.campaign.personnel.medical.advancedMedical
.SkillCheckUtility.java
so that non-Advanced Medical healing checks now use the centralized skill check utility class.Dev Notes
This PR also includes the changes made in #6706