Package mekhq.campaign.unit
Class HangarStatistics
java.lang.Object
mekhq.campaign.unit.HangarStatistics
Provides methods to gather statistics on units in a hangar.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetNumberOfUnitsByType(long type) intgetNumberOfUnitsByType(long type, boolean inTransit) intgetNumberOfUnitsByType(long type, boolean inTransit, boolean lv) intgetOccupiedBays(long type) intgetOccupiedBays(long type, boolean lv) intintintintintintintintintintinttallyBaysByType(boolean inTransit) Tallies the number of units in the hangar by their entity type or bay category.
-
Constructor Details
-
HangarStatistics
-
-
Method Details
-
getHangar
-
getNumberOfUnitsByType
public int getNumberOfUnitsByType(long type) -
getNumberOfUnitsByType
public int getNumberOfUnitsByType(long type, boolean inTransit) -
tallyBaysByType
Tallies the number of units in the hangar by their entity type or bay category.The returned
HashMapmaps entity type identifiers (or entity type plus vehicle bitmask) to the count of units of that type currently in the hangar.- If
inTransitis false, only present (not in-transit) units are considered. - Mothballed units are counted using the
Unit.ETYPE_MOTHBALLEDkey. - Tanks are tallied into three categories based on unit weight:
- Light Vehicles:
weight ≤ 50.0 (with LIGHT_VEHICLE_BIT) - Heavy Vehicles:
50.0 < weight ≤ 100.0 - Super Heavy:
weight > 100.0 (with SUPER_HEAVY_BIT)
- Light Vehicles:
- Other unit types (Mek, DropShip, Small Craft, etc.) use their respective entity type long constants.
- Infantry and BattleArmor are separated; only true Infantry (not BattleArmor) are counted under
Entity.ETYPE_INFANTRY. - Types not covered by the checked entity classes are not included in the result.
- Parameters:
inTransit- if true, includes units that are in transit; if false, only includes units that are present- Returns:
- a
HashMapmapping entity type (or bay type) keys to the number of distinct units of that type in the hangar
- If
-
getNumberOfUnitsByType
public int getNumberOfUnitsByType(long type, boolean inTransit, boolean lv) -
getOccupiedBays
public int getOccupiedBays(long type) -
getOccupiedBays
public int getOccupiedBays(long type, boolean lv) -
getTotalMekBays
public int getTotalMekBays() -
getTotalASFBays
public int getTotalASFBays() -
getTotalSmallCraftBays
public int getTotalSmallCraftBays() -
getTotalBattleArmorBays
public int getTotalBattleArmorBays() -
getTotalInfantryBays
public int getTotalInfantryBays() -
getTotalHeavyVehicleBays
public int getTotalHeavyVehicleBays() -
getTotalSuperHeavyVehicleBays
public int getTotalSuperHeavyVehicleBays() -
getTotalLightVehicleBays
public int getTotalLightVehicleBays() -
getTotalProtoMekBays
public int getTotalProtoMekBays() -
getTotalDockingCollars
public int getTotalDockingCollars() -
getTotalLargeCraftPassengerCapacity
public int getTotalLargeCraftPassengerCapacity()
-