Class ProtoMekClampMount

java.lang.Object
megamek.common.battleArmor.BattleArmorHandles
megamek.common.battleArmor.ProtoMekClampMount
All Implemented Interfaces:
Serializable, Transporter

public class ProtoMekClampMount extends BattleArmorHandles
Represents a section of a Mek torso where a protomek equipped with the magnetic clamp system can attach itself for transport. A mek has two of these, one front and one rear. An ultraheavy protomek can only be carried on the front mount, and if carried this way the rear cannot be used. The two mounts are not aware of each other, and it is the responsibility of the code that handles loading to enforce this limitation.
See Also:
  • Constructor Details

    • ProtoMekClampMount

      public ProtoMekClampMount(boolean rear)
  • Method Details

    • isRear

      public boolean isRear()
    • getUnusedString

      public String getUnusedString()
      Description copied from interface: Transporter
      Return a string that identifies the unused capacity of this transporter.
      Specified by:
      getUnusedString in interface Transporter
      Overrides:
      getUnusedString in class BattleArmorHandles
      Returns:
      A String meant for a human.
    • canLoad

      public boolean canLoad(Entity unit)
      Description copied from interface: Transporter
      Determines if this object can accept the given unit. The unit may not be of the appropriate type or there may be no room for the unit.
      Specified by:
      canLoad in interface Transporter
      Overrides:
      canLoad in class BattleArmorHandles
      Parameters:
      unit - - the Entity to be loaded.
      Returns:
      true if the unit can be loaded, false otherwise.
    • isWeaponBlockedAt

      public boolean isWeaponBlockedAt(int loc, boolean isRear)
      Description copied from interface: Transporter
      Determine if transported units prevent a weapon in the given location from firing.
      Specified by:
      isWeaponBlockedAt in interface Transporter
      Overrides:
      isWeaponBlockedAt in class BattleArmorHandles
      Parameters:
      loc - the location attempting to fire.
      isRear - true if the weapon is rear-facing
      Returns:
      True if a transported unit is in the way, false if the weapon can fire.
    • getCargoMpReduction

      public int getCargoMpReduction(Entity carrier)
      Specified by:
      getCargoMpReduction in interface Transporter
      Overrides:
      getCargoMpReduction in class BattleArmorHandles
      Returns:
      the MP reduction due to cargo carried by this transporter
    • toString

      public String toString()
      Overrides:
      toString in class BattleArmorHandles