Class MekConstructionUtil

java.lang.Object
megamek.common.units.MekConstructionUtil

public class MekConstructionUtil extends Object
Helper methods for constructing/changing Mek units. This happens mostly in MML but some units have modular equipment which MM must be able to switch out and the code for this is involved and should be unified as much as possible.

This is the MM extension of MekUtil.

  • Constructor Details

    • MekConstructionUtil

      public MekConstructionUtil()
  • Method Details

    • updateClanCasePlacement

      public static void updateClanCasePlacement(Mek mek)
      For the given Mek, removes all existing Clan CASE and then re-adds it to every location that has potentially explosive equipment (this includes PPC Capacitors). Skips locations that already have (IS) CASE or CASE II. Respects per-location opt-out.
      Parameters:
      mek - the mek to update
    • removeAllMounted

      public static void removeAllMounted(Entity unit, EquipmentType et)
    • addClanCaseToExplosiveLocations

      public static void addClanCaseToExplosiveLocations(Mek mek)
      Adds Clan CASE to all locations on the Mek that have explosive equipment and don't already have CASE or CASE II. Unlike Mek.addClanCase(), this does not check tech base or existing Clan CASE presence. Respects per-location opt-out via Mek.isClanCaseOptedOut(int).
      Parameters:
      mek - the mek to add Clan CASE to
    • removesHandAndLowerArmSlotsOnOmni

      public static boolean removesHandAndLowerArmSlotsOnOmni(EquipmentType equipmentType)
      Parameters:
      equipmentType - The equipment type to check
      Returns:
      True when given type of equipment is one that forbids lower arm and hand actuators on an omni mek, see TM p.57