Class TransportCalculator

java.lang.Object
megamek.client.ratgenerator.TransportCalculator

public class TransportCalculator extends Object
Generates drop-ships and jump ships to fulfill transport requirements for a unit.
  • Constructor Details

  • Method Details

    • dispose

      public static void dispose()
    • calcDropships

      public List<MekSummary> calcDropships(double ratio)
      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

      public List<MekSummary> calcJumpShips(double ratio, int transportCollars)
      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 unit
      transportCollars - The number of dropships generated for transport
      Returns:
      A list of generated jump ships
    • calcWarShips

      public List<MekSummary> calcWarShips(double ratio, int transportCollars)
      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 WarShips
      transportCollars - 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

      public static int fighterBayCapacity(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. 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