Package megamek.common.bays
Class CargoBay
java.lang.Object
megamek.common.bays.Bay
megamek.common.bays.CargoBay
- All Implemented Interfaces:
Serializable,Transporter,ITechnology,InfantryTransporter
Represents a volume of space set aside for carrying general cargo aboard large spacecraft and mobile structures.
- See Also:
-
Field Summary
Fields inherited from class megamek.common.bays.Bay
bayNumber, currentDoors, currentSpace, damage, doors, doorsNext, FACING_PREFIX, FIELD_SEPARATOR, game, loadedThisTurn, minDoors, recoverySlots, totalSpace, troops, unloadedThisTurn, UNSET_BAYFields inherited from interface megamek.common.interfaces.ITechnology
DATE_ES, DATE_NONE, DATE_PS -
Constructor Summary
ConstructorsConstructorDescriptionCargoBay(double space, int doors, int bayNumber) Create a space for the given tonnage of troops. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines if this object can accept the given unit.booleangetUnusedString(boolean showRecovery) Return a string that identifies the unused capacity of this transporter.booleanisCargo()doublespaceForUnit(Entity unit) Most bay types track space by individual units.toString()Updated toString() and helpers to normalize bay string output To match new 6-field format: type:space(current or total):doors:bayNumber:infantryType:facing:status bitmap See BLKFile.java:BLKFile constantsMethods inherited from class megamek.common.bays.Bay
artsTechAdvancement, bayString, bayString, bayString, destroyDoor, destroyDoorNext, getBaseAvailability, getBayDamage, getBayNumber, getCapacity, getCargoMpReduction, getCommonDate, getCost, getCurrentDoors, getDefaultSlotDescription, getDoors, getDoorsNext, getDroppableUnits, getExteriorUnitAt, getExternalUnits, getExtinctionDate, getExtinctionDate, getFacing, getIntroductionDate, getIntroductionDate, getLaunchableUnits, getLoadedUnitIds, getLoadedUnits, getMinDoors, getNumberLoadedThisTurn, getNumberUnloadedThisTurn, getPersonnel, getProductionDate, getProductionDate, getPrototypeDate, getPrototypeDate, getReintroductionDate, getReintroductionDate, getSafeLaunchRate, getStaticTechLevel, getTechAdvancement, getTechBase, getTechRating, getTroops, getUnloadableUnits, getUnused, getUnusedSlots, getUnusedString, getWeight, isClan, isMixedTech, isQuarters, isWeaponBlockedAt, load, numDoorsString, resetCounts, resetDoors, resetTransporter, restoreAllDoors, restoreDoor, setBayDamage, setCurrentDoors, setCurrentSpace, setDoors, setDoorsNext, setFacing, setGame, techAdvancement, unloadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface megamek.common.units.InfantryTransporter
getCurrentDoors, getDroppableUnits, getLoadedUnits, getUnused, getUnusedSlots, loadMethods inherited from interface megamek.common.interfaces.ITechnology
calcEraAvailability, calcEraAvailability, calcYearAvailability, calcYearAvailability, calcYearAvailability, findMinimumRulesLevel, findMinimumRulesLevel, getAdvancedRange, getAdvancedRange, getCodeFromIOAbbr, getCodeFromMMAbbr, getCommonDate, getEraAvailabilityName, getEraAvailabilityName, getExperimentalRange, getExperimentalRange, getExtinctionDate, getExtinctionRange, getExtinctionRange, getFullRatingName, getFullRatingName, getIntroductionDate, getProductionDate, getPrototypeDate, getReintroductionDate, getSimpleLevel, getSimpleLevel, getSimpleLevel, getStandardRange, getStandardRange, getTechLevel, getTechLevel, getTechRatingName, isAvailableIn, isAvailableIn, isAvailableIn, isExtinct, isExtinct, isExtinct, isIntroLevel, isLegal, isLegal, isUnofficialMethods inherited from interface megamek.common.equipment.Transporter
alwaysDamageCargoIfTransportHit, canPickupGroundObject, canTow, getCarryables, getNameForRecordSheets, hardpointCost, setEntity
-
Constructor Details
-
CargoBay
public CargoBay(double space, int doors, int bayNumber) Create a space for the given tonnage of troops. For this class, only the weight of the troops (and their equipment) are considered; if you'd like to think that they are stacked like lumber, be my guest.- Parameters:
space- The weight of troops (in tons) this space can carry.
-
-
Method Details
-
canLoad
Description copied from interface:TransporterDetermines 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 interfaceInfantryTransporter- Specified by:
canLoadin interfaceTransporter- Overrides:
canLoadin classBay- Parameters:
unit- - theEntityto be loaded.- Returns:
trueif the unit can be loaded,falseotherwise.
-
canUnloadUnits
public boolean canUnloadUnits()- Overrides:
canUnloadUnitsin classBay- Returns:
- True when further doors are available to unload units this turn. This method checks only the state of bay doors, not if it has units left to unload or the status of those.
-
spaceForUnit
Description copied from class:BayMost bay types track space by individual units. Infantry bays have variable space requirements and must track by cubicle tonnage.- Specified by:
spaceForUnitin interfaceInfantryTransporter- Overrides:
spaceForUnitin classBay- Parameters:
unit- The unit to load/unload.- Returns:
- The amount of bay space taken up by the unit.
-
getUnusedString
Description copied from class:BayReturn a string that identifies the unused capacity of this transporter.- Overrides:
getUnusedStringin classBay- Returns:
- A
Stringmeant for a human.
-
getTransporterType
- Specified by:
getTransporterTypein interfaceInfantryTransporter- Specified by:
getTransporterTypein interfaceTransporter
-
toString
Description copied from class:BayUpdated toString() and helpers to normalize bay string output To match new 6-field format: type:space(current or total):doors:bayNumber:infantryType:facing:status bitmap See BLKFile.java:BLKFile constants -
isCargo
public boolean isCargo()
-