Package megamek.common.verifier
Class TestAdvancedAerospace
java.lang.Object
megamek.common.verifier.TestEntity
megamek.common.verifier.TestAero
megamek.common.verifier.TestAdvancedAerospace
- All Implemented Interfaces:
TestEntityOption
Validation and construction data for advanced aerospace units (jump ships, warships, space stations)
-
Nested Class Summary
Nested classes/interfaces inherited from class megamek.common.verifier.TestAero
TestAero.Quarters
Nested classes/interfaces inherited from class megamek.common.verifier.TestEntity
TestEntity.Ceil
-
Field Summary
Fields inherited from class megamek.common.verifier.TestEntity
engine, fileString, structure
Fields inherited from interface megamek.common.verifier.TestEntityOption
CEIL_TARGCOMP_CRITS, FLOOR_TARGCOMP_CRITS, ROUND_TARGCOMP_CRITS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double
armorPointsPerTon
(Jumpship vessel, int at, boolean clan) static double
calculateEngineTonnage
(Jumpship vessel) Computes the weight of the engine.double
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.boolean
correctArmor
(StringBuffer buff) Checks to see if this unit has valid armor assignment.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.boolean
correctCrew
(StringBuffer buffer) Checks that the unit meets minimum crew and quarters requirements.boolean
correctEntity
(StringBuffer buff, int ammoTechLvl) boolean
correctGravDecks
(StringBuffer buffer) Checks that the unit does not exceed the maximum number or size of gravity decks.boolean
correctHeatSinks
(StringBuffer buff) Checks that the heatsink type is a legal value.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.getAero()
int
static int
getMaxDockingHardpoints
(Jumpship vessel) The maximum number of docking hard points (collars) depends on the tonnage of the vessel.static int
getMaxGravDeckDiameter
(Jumpship vessel) static int
getMaxGravDecks
(Jumpship vessel) static int
getMinTonnage
(Jumpship vessel) getName()
double
double
double
double
double
double
double
double
static int
getWeightIncrement
(Jumpship vessel) double
double
double
double
boolean
boolean
Check if the unit has combinations of equipment which are not allowed in the construction rules.boolean
legalArmorsFor
(ITechManager techManager, boolean primitive) Filters all capital armor according to given tech constraintsstatic int
maxArmorPoints
(Jumpship vessel) static double
maxArmorWeight
(Jumpship vessel) Computes the maximum number armor level in tonsstatic int
minimumBaseCrew
(Jumpship vessel) static double
primitiveControlMultiplier
(int year) static double
primitiveEngineMultiplier
(int year) static int
requiredGunners
(Jumpship vessel) One gunner is required for each capital weapon and each six standard scale weapons, rounding upstatic int
weightFreeHeatSinks
(Jumpship vessel) Methods inherited from class megamek.common.verifier.TestAero
availableSpace, calculateDaysAt1G, calculateDaysAtMax, calculateEngineRating, checkCriticalSlotsForEquipment, correctControlSystems, correctCriticals, eqRequiresLocation, getMaxTonnage, getPrimitiveDropshipMaxTonnage, getPrimitiveJumpshipMaxTonnage, getWeightMisc, getWeightMiscEquip, getWeightPowerAmp, getWeightQuarters, getWeightStructure, hasMismatchedLateralWeapons, isAero, isAeroWeapon, isMek, isProtoMek, isSmallCraft, isTank, isValidAeroLocation, legalArmorsFor, maxArmorPoints, maxBayDoors, minimumBaseCrew, printArmorLocProp, printWeightMisc, printWeightQuarters, requiredGunners, slotsPerArc, usesWeaponSlot, weightFreeHeatSinks
Methods inherited from class megamek.common.verifier.TestEntity
calcHeatNeutralHSRequirement, calcMiscCrits, calculateWeight, ceil, ceilMaxHalf, correctArmorOverAllocation, correctEntity, correctWeight, correctWeight, eqRequiresLocation, equipmentCrewRequirements, floor, getArmoredComponentWeight, getArmorPoints, getArmorPoints, getArmorPointsPerTon, getEntityVerifier, getIntroYearMargin, getLocationAbbr, getMaximumArmorPoints, getMaxOverweight, getMinUnderweight, getMPBoosters, getPrintSize, getRawArmorPoints, getRawWeightArmor, getSIBonusArmorPoints, getSystemWideLocation, getTargCompCrits, getTotalOArmor, getWeight, getWeightAllocatedArmor, getWeightArmor, getWeightArmor, getWeightCarryingSpace, getWeightCeilingArmor, getWeightCeilingControls, getWeightCeilingEngine, getWeightCeilingGyro, getWeightCeilingLifting, getWeightCeilingPowerAmp, getWeightCeilingStructure, getWeightCeilingTargComp, getWeightCeilingTurret, getWeightCeilingWeapons, getWeightWeapon, hasFailedEquipment, hasIllegalTechLevels, hasIllegalTechLevels, hasIncorrectIntroYear, heatNeutralHSRequirement, ignoreFailedEquip, includeMiscEquip, isClan, isClanArmor, isValidLocation, legalArmorsFor, printAmmo, printAmmo, printArmorLocation, printArmorPlacement, printFailedEquipment, printMiscEquip, printMiscEquip, printMiscEquip, printShortMovement, printSource, printTechLevel, printWeapon, printWeapon, printWeightArmor, printWeightCarryingSpace, printWeightHeatSinks, printWeightStructure, round, setPrecision, showCorrectArmor, showCorrectCritical, showFailedEquip, showIncorrectIntroYear, showOverweightedEntity, showUnderweightedEntity, skip, totalCritSlotCount, usesKgStandard, validJumpJets
-
Constructor Details
-
TestAdvancedAerospace
-
-
Method Details
-
legalArmorsFor
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
-
maxArmorWeight
Computes the maximum number armor level in tons -
armorPointsPerTon
-
extraSlotCost
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
-
getWeightIncrement
-
calculateEngineTonnage
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
- Parameters:
vessel
- An advanced aerospace unit- Returns:
- The number of heat sinks that are accounted for in the engine weight.
-
getMaxDockingHardpoints
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
- Parameters:
vessel
- The ship- Returns:
- The maximum number of gravity decks that can be mounted on the ship.
-
getMaxGravDeckDiameter
- Parameters:
vessel
- The ship- Returns:
- The maximum diameter (in meters) for a grav deck mounted on the unit.
-
minimumBaseCrew
- Returns:
- Minimum crew requirements based on unit type and equipment crew requirements.
-
requiredGunners
One gunner is required for each capital weapon and each six standard scale weapons, rounding up- Returns:
- The vessel's minimum gunner requirements.
-
getEntity
-
isAdvancedAerospace
public boolean isAdvancedAerospace()- Overrides:
isAdvancedAerospace
in classTestAero
-
getWeightControls
public double getWeightControls()- Overrides:
getWeightControls
in classTestAero
-
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 classTestAero
-
printWeightEngine
- Overrides:
printWeightEngine
in classTestEntity
-
getWeightKFDrive
public double getWeightKFDrive() -
printWeightKFDrive
-
getWeightSail
public double getWeightSail() -
printWeightSail
-
getWeightFuel
public double getWeightFuel()- Overrides:
getWeightFuel
in classTestAero
-
getCountHeatSinks
public int getCountHeatSinks()- Overrides:
getCountHeatSinks
in classTestAero
-
getWeightHeatSinks
public double getWeightHeatSinks()- Overrides:
getWeightHeatSinks
in classTestAero
-
getWeightAmmo
public double getWeightAmmo()- Overrides:
getWeightAmmo
in classTestEntity
-
getWeightGravDecks
public double getWeightGravDecks()- Returns:
- The combined weight of grav decks mounted on the vessel
-
printWeightGravDecks
-
getWeightLifeBoats
public double getWeightLifeBoats()- Returns:
- The combined weight of all lifeboats and escape pods
-
printWeightLifeBoats
-
getWeightFireControl
public double getWeightFireControl()- Returns:
- Extra fire control system weight for exceeding base slot limit per firing arc
-
printWeightFireControl
-
getWeightLFBattery
public double getWeightLFBattery()- Returns:
- The weight of the lithium fusion battery (0 if not present).
-
printWeightLFBattery
-
getWeightHardpoints
public double getWeightHardpoints() -
printWeightHardpoints
-
printWeapon
- Overrides:
printWeapon
in classTestEntity
-
printAmmo
- Overrides:
printAmmo
in classTestEntity
-
hasDoubleHeatSinks
public boolean hasDoubleHeatSinks()- Overrides:
hasDoubleHeatSinks
in classTestAero
-
printWeightControls
- Overrides:
printWeightControls
in classTestAero
-
printWeightFuel
- Overrides:
printWeightFuel
in classTestAero
-
getAero
-
getAdvancedAerospace
-
correctArmor
Checks to see if this unit has valid armor assignment.- Overrides:
correctArmor
in classTestAero
- Parameters:
buff
- The StringBuffer to receive error descriptions- Returns:
- False when something is invalid, true otherwise
-
correctHeatSinks
Checks that the heatsink type is a legal value.- Overrides:
correctHeatSinks
in classTestAero
- Parameters:
buff
- The StringBuffer to receive error descriptions- Returns:
- False when something is invalid, true otherwise
-
correctEntity
- Overrides:
correctEntity
in classTestAero
-
hasIllegalEquipmentCombinations
Description copied from class:TestEntity
Check if the unit has combinations of equipment which are not allowed in the construction rules.- Overrides:
hasIllegalEquipmentCombinations
in classTestEntity
- Parameters:
buff
- diagnostics are appended to this- Returns:
- true if the entity is illegal
-
correctCrew
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
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
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
- Overrides:
printEntity
in classTestAero
-
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 classTestAero
- Returns:
- The unrounded weight of the unit.
-
printWeightCalculation
- Overrides:
printWeightCalculation
in classTestAero
-
printLocations
- Overrides:
printLocations
in classTestAero
-
getName
-