Class CrewQuartersCargoBay

java.lang.Object
megamek.common.bays.Bay
megamek.common.bays.CrewQuartersCargoBay
All Implemented Interfaces:
Serializable, Transporter, ITechnology

public final class CrewQuartersCargoBay extends Bay
Represents a volume of space set aside for carrying a mobile structure or spacecraft's crew
See Also:
  • Constructor Details

    • CrewQuartersCargoBay

      public CrewQuartersCargoBay(double weight, int doors)
      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:
      weight - The weight of troops (in tons) this space can carry.
    • CrewQuartersCargoBay

      public CrewQuartersCargoBay(int space)
      Create space for certain number of crew/passengers
      Parameters:
      space - The number of crew or passengers to accommodate
  • 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 Bay
      Parameters:
      unit - - the Entity to be loaded.
      Returns:
      true if the unit can be loaded, false otherwise.
    • getUnusedString

      public String getUnusedString(boolean showRecovery)
      Description copied from class: Bay
      Return a string that identifies the unused capacity of this transporter.
      Overrides:
      getUnusedString in class Bay
      Returns:
      A String meant for a human.
    • isQuarters

      public boolean isQuarters()
      Overrides:
      isQuarters in class Bay
      Returns:
      true if this bay represents crew quarters or seating rather than a unit transport bay.
    • getType

      public String getType()
    • getWeight

      public double getWeight()
      Overrides:
      getWeight in class Bay
      Returns:
      the tonnage of the bay, not the actual mass or weight
    • toString

      public String toString()
      Description copied from class: Bay
      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 constants
      Overrides:
      toString in class Bay
    • getCost

      public long getCost()
      Overrides:
      getCost in class Bay
      Returns:
      The cost of the bay in C-bills