BFS Assets - #9653
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates MekHQ’s unit selector filtering to use shared, gap-robust unit-type mapping and centralized unit-type matching logic, rather than relying on positional combo-box indices and a localized “Support Vehicle” string check.
Changes:
- Replaces inlined unit-type/support-vehicle filter logic with a
matchesUnitTypeSelection(...)helper. - Switches unit-type selection handling to a “code for combo index” mapping to avoid index drift when unit types are omitted from the shared combo.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9653 +/- ##
============================================
- Coverage 20.61% 20.60% -0.02%
- Complexity 13351 13365 +14
============================================
Files 1497 1497
Lines 182829 182852 +23
Branches 28092 28092
============================================
- Hits 37688 37673 -15
- Misses 141403 141439 +36
- Partials 3738 3740 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
| if git ls-remote --exit-code --heads \ | ||
| ${{ github.event.pull_request.head.repo.owner.html_url }}/mm-data.git \ | ||
| ${{ github.event.pull_request.head.ref }} > /dev/null 2>&1 |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Suppressed comments (1)
MekHQ/unittests/mekhq/gui/dialog/MekHQUnitSelectorDialogTest.java:89
- This test relies on Mockito defaults for
getUnitType()andhasDroneOs()to represent a “supported” entity. That makes it brittle (e.g., if the default int happens to matchUnitType.GUN_EMPLACEMENT, or if the unsupported criteria evolve). Stub the relevant methods explicitly so the test only validatesisCampaignAcquisitionCandidatelogic.
@Test
void campaignActionsKeepSupportedStandardEntity() {
Entity entity = mock(Entity.class);
assertTrue(MekHQUnitSelectorDialog.isCampaignAcquisitionCandidate(entity));
| } | ||
| MekTableModel mekModel = entry.getModel(); | ||
| MekSummary mek = mekModel.getMekSummary(entry.getIdentifier()); | ||
| ITechnology tech = UnitTechProgression.getProgression(mek, campaign.getTechFaction(), true); |
Must be merged with PRs MegaMek/megameklab#2264. MegaMek/mekhq#9653, MegaMek/mm-data#470 ## Add Battlefield Support Assets This adds Battlefield Support Assets as a first-class unit type, using a new `.bfs` YAML format for their card-based stats and UUID links to corresponding standard units. Assets are integrated into the unit cache and selector, include Advanced Search filters, render printable BFS cards, and support standalone or linked unit forms. The update also adds lobby selection and configuration, Regular/Veteran crews and costs, persistent damage and MUL round-tripping, distinctive camouflage overlays, and dedicated Summary, TRO, and BFS Card views. This PR provides the data model and non-gameplay infrastructure; the Asset movement and combat rules will follow separately.
Must be merged with PRs MegaMek/megamek#8533, MegaMek/megameklab#2264. MegaMek/mm-data#470