Class RoofRack

java.lang.Object
megamek.common.equipment.ExternalCargo
megamek.common.equipment.RoofRack
All Implemented Interfaces:
Serializable, Transporter

public class RoofRack extends ExternalCargo
Cargo Carrier TW p. 261. Unprotected, in slings, strapped to the top, in lightweight containers and so on.
See Also:
  • Constructor Details

    • RoofRack

      public RoofRack(double tonnage)
  • Method Details

    • canLoad

      public boolean canLoad(Entity unit)
      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 ExternalCargo
      Parameters:
      unit - - the Entity to be loaded.
      Returns:
      true if the unit can be loaded, false otherwise.
    • load

      public void load(Entity unit) throws IllegalArgumentException
      Load the given unit.
      Specified by:
      load in interface Transporter
      Overrides:
      load in class ExternalCargo
      Parameters:
      unit - the Entity to be loaded.
      Throws:
      IllegalArgumentException - If the unit can't be loaded
    • getCargoMpReduction

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

      protected boolean maxObjects(int location)
      Overrides:
      maxObjects in class ExternalCargo
    • getTransporterType

      public String getTransporterType()
    • alwaysDamageCargoIfTransportHit

      public boolean alwaysDamageCargoIfTransportHit()
      Returns true if the transporter damages its cargo if the transport is hit, otherwise false.