Class TestAdvancedAerospace

All Implemented Interfaces:
TestEntityOption

public class TestAdvancedAerospace extends TestAero
Validation and construction data for advanced aerospace units (jump ships, warships, space stations)
  • Constructor Details

  • Method Details

    • legalArmorsFor

      public static List<ArmorType> legalArmorsFor(ITechManager techManager, boolean primitive)
      Filters all capital armor according to given tech constraints
      Parameters:
      techManager - Constraints used to filter the possible armor types
      Returns:
      A list of all armors that meet the tech constraints
    • maxArmorPoints

      public static int maxArmorPoints(Jumpship vessel)
    • maxArmorWeight

      public static double maxArmorWeight(Jumpship vessel)
      Computes the maximum number armor level in tons
    • armorPointsPerTon

      public static double armorPointsPerTon(Jumpship vessel, int at, boolean clan)
    • extraSlotCost

      public static double[] extraSlotCost(Jumpship vessel)
      Computes the amount of weight required for fire control systems and power distribution systems for exceeding the base limit of weapons per firing arc.
      Parameters:
      vessel - The advanced aerospace unit in question
      Returns:
      Returns a double array, where each element corresponds to a location and the value is the extra tonnage required by exceeding the base allotment
    • getMinTonnage

      public static int getMinTonnage(Jumpship vessel)
    • getWeightIncrement

      public static int getWeightIncrement(Jumpship vessel)
    • calculateEngineTonnage

      public static double calculateEngineTonnage(Jumpship vessel)
      Computes the weight of the engine.
      Parameters:
      vessel - The ship
      Returns:
      The weight of the engine in tons
    • primitiveEngineMultiplier

      public static double primitiveEngineMultiplier(int year)
      Parameters:
      year - The original construction year of the jumpship chassis
      Returns:
      The engine weight multiplier for the primitive jumpship.
    • weightFreeHeatSinks

      public static int weightFreeHeatSinks(Jumpship vessel)
      Parameters:
      vessel - An advanced aerospace unit
      Returns:
      The number of heat sinks that are accounted for in the engine weight.
    • getMaxDockingHardpoints

      public static int getMaxDockingHardpoints(Jumpship vessel)
      The maximum number of docking hard points (collars) depends on the tonnage of the vessel. Naval Repair Facilities and Drop shuttle bays count against the total and reduce the maximum number by two each.
      Parameters:
      vessel - The ship
      Returns:
      The maximum number of docking hard points (collars) that can be mounted on the ship.
    • getMaxGravDecks

      public static int getMaxGravDecks(Jumpship vessel)
      Parameters:
      vessel - The ship
      Returns:
      The maximum number of gravity decks that can be mounted on the ship.
    • getMaxGravDeckDiameter

      public static int getMaxGravDeckDiameter(Jumpship vessel)
      Parameters:
      vessel - The ship
      Returns:
      The maximum diameter (in meters) for a grav deck mounted on the unit.
    • minimumBaseCrew

      public static int minimumBaseCrew(Jumpship vessel)
      Returns:
      Minimum crew requirements based on unit type and equipment crew requirements.
    • requiredGunners

      public static int requiredGunners(Jumpship vessel)
      One gunner is required for each capital weapon and each six standard scale weapons, rounding up
      Returns:
      The vessel's minimum gunner requirements.
    • getEntity

      public Entity getEntity()
      Overrides:
      getEntity in class TestAero
    • isAdvancedAerospace

      public boolean isAdvancedAerospace()
      Overrides:
      isAdvancedAerospace in class TestAero
    • getWeightControls

      public double getWeightControls()
      Overrides:
      getWeightControls in class TestAero
    • primitiveControlMultiplier

      public static double primitiveControlMultiplier(int year)
      Parameters:
      year - The original construction year of the jumpship chassis
      Returns:
      The control weight multiplier for the primitive jumpship.
    • getWeightEngine

      public double getWeightEngine()
      Overrides:
      getWeightEngine in class TestAero
    • printWeightEngine

      public String printWeightEngine()
      Overrides:
      printWeightEngine in class TestEntity
    • getWeightKFDrive

      public double getWeightKFDrive()
    • printWeightKFDrive

      public String printWeightKFDrive()
    • getWeightSail

      public double getWeightSail()
    • printWeightSail

      public String printWeightSail()
    • getWeightFuel

      public double getWeightFuel()
      Overrides:
      getWeightFuel in class TestAero
    • getCountHeatSinks

      public int getCountHeatSinks()
      Overrides:
      getCountHeatSinks in class TestAero
    • getWeightHeatSinks

      public double getWeightHeatSinks()
      Overrides:
      getWeightHeatSinks in class TestAero
    • getWeightAmmo

      public double getWeightAmmo()
      Overrides:
      getWeightAmmo in class TestEntity
    • getWeightGravDecks

      public double getWeightGravDecks()
      Returns:
      The combined weight of grav decks mounted on the vessel
    • printWeightGravDecks

      public String printWeightGravDecks()
    • getWeightLifeBoats

      public double getWeightLifeBoats()
      Returns:
      The combined weight of all lifeboats and escape pods
    • printWeightLifeBoats

      public String printWeightLifeBoats()
    • getWeightFireControl

      public double getWeightFireControl()
      Returns:
      Extra fire control system weight for exceeding base slot limit per firing arc
    • printWeightFireControl

      public String printWeightFireControl()
    • getWeightLFBattery

      public double getWeightLFBattery()
      Returns:
      The weight of the lithium fusion battery (0 if not present).
    • printWeightLFBattery

      public String printWeightLFBattery()
    • getWeightHardpoints

      public double getWeightHardpoints()
    • printWeightHardpoints

      public String printWeightHardpoints()
    • printWeapon

      public StringBuffer printWeapon()
      Overrides:
      printWeapon in class TestEntity
    • printAmmo

      public StringBuffer printAmmo()
      Overrides:
      printAmmo in class TestEntity
    • hasDoubleHeatSinks

      public boolean hasDoubleHeatSinks()
      Overrides:
      hasDoubleHeatSinks in class TestAero
    • printWeightControls

      public String printWeightControls()
      Overrides:
      printWeightControls in class TestAero
    • printWeightFuel

      public String printWeightFuel()
      Overrides:
      printWeightFuel in class TestAero
    • getAero

      public Aero getAero()
      Overrides:
      getAero in class TestAero
    • getAdvancedAerospace

      public Jumpship getAdvancedAerospace()
    • correctArmor

      public boolean correctArmor(StringBuffer buff)
      Checks to see if this unit has valid armor assignment.
      Overrides:
      correctArmor in class TestAero
      Parameters:
      buff - The StringBuffer to receive error descriptions
      Returns:
      False when something is invalid, true otherwise
    • correctHeatSinks

      public boolean correctHeatSinks(StringBuffer buff)
      Checks that the heatsink type is a legal value.
      Overrides:
      correctHeatSinks in class TestAero
      Parameters:
      buff - The StringBuffer to receive error descriptions
      Returns:
      False when something is invalid, true otherwise
    • correctEntity

      public boolean correctEntity(StringBuffer buff, int ammoTechLvl)
      Overrides:
      correctEntity in class TestAero
    • hasIllegalEquipmentCombinations

      public boolean hasIllegalEquipmentCombinations(StringBuffer buff)
      Description copied from class: TestEntity
      Check if the unit has combinations of equipment which are not allowed in the construction rules.
      Overrides:
      hasIllegalEquipmentCombinations in class TestEntity
      Parameters:
      buff - diagnostics are appended to this
      Returns:
      true if the entity is illegal
    • correctCrew

      public boolean correctCrew(StringBuffer buffer)
      Checks that the unit meets minimum crew and quarters requirements.
      Parameters:
      buffer - Where to write messages explaining failures.
      Returns:
      true if the crew data is valid.
    • correctGravDecks

      public boolean correctGravDecks(StringBuffer buffer)
      Checks that the unit does not exceed the maximum number or size of gravity decks.
      Parameters:
      buffer - Where to write messages explaining failures.
      Returns:
      true if the crew data is valid.
    • correctBays

      public boolean correctBays(StringBuffer buffer)
      Checks that the unit does not have more than one naval repair facility or drop shuttle bay per facing, all are assigned a facing, and non-stations have no more than one repair facility.
      Parameters:
      buffer - Where to write messages explaining failures.
      Returns:
      true if the bay data is valid
    • printEntity

      public StringBuffer printEntity()
      Overrides:
      printEntity in class TestAero
    • calculateWeightExact

      public double calculateWeightExact()
      Description copied from class: TestEntity
      According to TM p.22, unit weights are to be rounded up to the nearest half ton or kilo, but in MML for construction at least we should be able to show the exact weight. This method returns the unrounded weight.
      Overrides:
      calculateWeightExact in class TestAero
      Returns:
      The unrounded weight of the unit.
    • printWeightCalculation

      public String printWeightCalculation()
      Overrides:
      printWeightCalculation in class TestAero
    • printLocations

      public String printLocations()
      Overrides:
      printLocations in class TestAero
    • getName

      public String getName()
      Overrides:
      getName in class TestAero