Package megamek.client.ratgenerator
Class TransportCalculator
java.lang.Object
megamek.client.ratgenerator.TransportCalculator
Generates drop-ships and jump ships to fulfill transport requirements for a unit.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalcDropships(double ratio) Generates dropships to provide enough capacity to transport the given ratio of the formation.calcJumpShips(double ratio, int transportCollars) Generates jump ships to provide enough docking collars to transport the given ratio of dropships.calcWarShips(double ratio, int transportCollars) Generates WarShips to provide additional docking collars for transporting DropShips.static voiddispose()static intfighterBayCapacity(MekSummary mekSummary) Returns the Aerospace Fighter bay capacity of a unit (how many fighters it can carry), loading the Entity once and caching the result.
-
Constructor Details
-
TransportCalculator
-
-
Method Details
-
dispose
public static void dispose() -
calcDropships
Generates dropships to provide enough capacity to transport the given ratio of the formation.- Parameters:
ratio- The ratio of dropships to generate to the total needs of the unit- Returns:
- A list of generated dropships
-
calcJumpShips
Generates jump ships to provide enough docking collars to transport the given ratio of dropships.- Parameters:
ratio- The ratio of jump ships to generate to the total needs of the unittransportCollars- The number of dropships generated for transport- Returns:
- A list of generated jump ships
-
calcWarShips
Generates WarShips to provide additional docking collars for transporting DropShips. WarShips also serve as combat vessels in Clan toumans and IS naval fleets; this method only sizes the fleet to the docking-collar requirement implied by the ratio. The ratio is independent of the jumpship ratio, so callers can request, for example, 50% WarShip coverage + 50% JumpShip coverage to split the fleet evenly.- Parameters:
ratio- The fraction (0.0–1.0+) of total DropShip docking demand to fulfill via WarShipstransportCollars- The number of DropShips that need docking-collar capacity- Returns:
- The list of generated WarShips. May be empty if no WarShip is available for the faction/year/rating.
-
fighterBayCapacity
Returns the Aerospace Fighter bay capacity of a unit (how many fighters it can carry), loading the Entity once and caching the result. Used to size the carried fighter complement of WarShips, DropShips, JumpShips, and Space Stations.- Parameters:
mekSummary- the carrier unit- Returns:
- number of fighters the unit can carry, or 0 if none / could not be loaded
-