Package megamek.common.equipment
Class RoofRack
java.lang.Object
megamek.common.equipment.ExternalCargo
megamek.common.equipment.RoofRack
- All Implemented Interfaces:
Serializable,Transporter
Cargo Carrier TW p. 261. Unprotected, in slings, strapped to the top, in lightweight containers and so on.
- See Also:
-
Field Summary
Fields inherited from class megamek.common.equipment.ExternalCargo
entity, entityId, game, totalSpace -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the transporter damages its cargo if the transport is hit, otherwise false.booleanDetermines if this object can accept the given unit.intgetCargoMpReduction(Entity carrier) voidLoad the given unit.protected booleanmaxObjects(int location) Methods inherited from class megamek.common.equipment.ExternalCargo
canLoad, canLoadCarryable, getCarriedTonnage, getCarryables, getCarryables, getExteriorUnitAt, getExternalUnits, getLoadedUnits, getLocations, getUnused, getUnusedString, isWeaponBlockedAt, loadCarryable, loadCarryable, resetTransporter, setEntity, setGame, unload, unloadCarryableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface megamek.common.equipment.Transporter
canPickupGroundObject, canTow, getNameForRecordSheets, getNumberLoadedThisTurn, getNumberUnloadedThisTurn, hardpointCost
-
Constructor Details
-
RoofRack
public RoofRack(double tonnage)
-
-
Method Details
-
canLoad
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:
canLoadin interfaceTransporter- Overrides:
canLoadin classExternalCargo- Parameters:
unit- - theEntityto be loaded.- Returns:
trueif the unit can be loaded,falseotherwise.
-
load
Load the given unit.- Specified by:
loadin interfaceTransporter- Overrides:
loadin classExternalCargo- Parameters:
unit- theEntityto be loaded.- Throws:
IllegalArgumentException- If the unit can't be loaded
-
getCargoMpReduction
- Specified by:
getCargoMpReductionin interfaceTransporter- Overrides:
getCargoMpReductionin classExternalCargo- Returns:
- the MP reduction due to cargo carried by this transporter
-
maxObjects
protected boolean maxObjects(int location) - Overrides:
maxObjectsin classExternalCargo
-
getTransporterType
-
alwaysDamageCargoIfTransportHit
public boolean alwaysDamageCargoIfTransportHit()Returns true if the transporter damages its cargo if the transport is hit, otherwise false.
-