subtype flags merged with flags#8469
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates MiscType equipment checks from the old subtype API (hasSubType() and bitwise operations on getSubType()) to the new flag-based API (hasFlag() and hasAnyFlag() using MiscTypeFlag enum). This change aligns with a corresponding MegaMek API update.
Key Changes:
- Replaced
hasSubType(MiscType.S_*)calls withhasFlag(MiscTypeFlag.S_*) - Replaced bitwise AND checks like
(type.getSubType() & MiscType.S_SUPERCHARGER) == 0with!type.hasFlag(MiscTypeFlag.S_SUPERCHARGER) - Used
hasAnyFlag()for conditions that check multiple alternative subtypes
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| MissingOmniPod.java | Updated SUPERCHARGER check from bitwise operation to hasFlag() negation |
| MissingMASC.java | Migrated isSupercharger() method from hasSubType() to hasFlag() |
| MissingJumpJet.java | Converted improved jump jet check from hasSubType() to hasFlag() |
| MASC.java | Migrated isSupercharger() method from hasSubType() to hasFlag() |
| EquipmentPart.java | Updated multiple subtype checks for club weapons, converting to hasFlag() and hasAnyFlag() |
| OmniPod.java | Updated SUPERCHARGER check from bitwise operation to hasFlag() negation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
The required PR can't be merged so this can't be merged. Do you have a change that you haven't committed? |
|
Flipping to draft to prevent merging prior to 50.11 launch |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #8469 +/- ##
=========================================
Coverage 12.61% 12.61%
- Complexity 7701 7702 +1
=========================================
Files 1302 1302
Lines 167217 167217
Branches 25184 25184
=========================================
+ Hits 21094 21097 +3
+ Misses 144028 144025 -3
Partials 2095 2095 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
subtype flags merged with flags
Requires MegaMek/megamek#7758