Package megamek.common.verifier
Class TestSmallCraft
java.lang.Object
megamek.common.verifier.TestEntity
megamek.common.verifier.TestAero
megamek.common.verifier.TestSmallCraft
- All Implemented Interfaces:
TestEntityOption
Class for testing and validating instantiations for Small Craft and Drop-ships.
-
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
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
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
calculateEngineTonnage
(boolean clan, double tonnage, int desiredSafeThrust, boolean dropship, int year) 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
correctCrew
(StringBuffer buffer) Checks that the unit meets minimum crew and quarters requirements.boolean
correctEntity
(StringBuffer buff, int ammoTechLvl) boolean
correctHeatSinks
(StringBuffer buff) Checks that the heatsink type is a legal value.static double
dropshipControlMultiplier
(int year) static double
dropshipEngineMultiplier
(int year) static double[]
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
getName()
double
double
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) Filters all small craft/drop-ship armor according to given tech constraintsstatic int
static double
maxArmorWeight
(SmallCraft smallCraft) Computes the maximum number armor level in tonsstatic int
static double
smallCraftControlMultiplier
(int year) static double
smallCraftEngineMultiplier
(int year) static int
Methods inherited from class megamek.common.verifier.TestAero
availableSpace, calculateDaysAt1G, calculateDaysAtMax, calculateEngineRating, checkCriticalSlotsForEquipment, correctControlSystems, correctCriticals, eqRequiresLocation, getMaxTonnage, getPrimitiveDropshipMaxTonnage, getPrimitiveJumpshipMaxTonnage, getWeightMiscEquip, getWeightPowerAmp, getWeightQuarters, getWeightStructure, hasMismatchedLateralWeapons, isAdvancedAerospace, isAero, isAeroWeapon, isMek, isProtoMek, isTank, isValidAeroLocation, maxArmorPoints, maxBayDoors, minimumBaseCrew, printArmorLocProp, 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
-
Field Details
-
ARC_NOSE
public static final int ARC_NOSE- See Also:
-
ARC_LWING
public static final int ARC_LWING- See Also:
-
ARC_RWING
public static final int ARC_RWING- See Also:
-
ARC_AFT
public static final int ARC_AFT- See Also:
-
REAR_ARC_OFFSET
public static final int REAR_ARC_OFFSET- See Also:
-
ARC_FWD_LEFT
public static final int ARC_FWD_LEFT- See Also:
-
ARC_FWD_RIGHT
public static final int ARC_FWD_RIGHT- See Also:
-
ARC_AFT_LEFT
public static final int ARC_AFT_LEFT- See Also:
-
ARC_AFT_RIGHT
public static final int ARC_AFT_RIGHT- See Also:
-
-
Constructor Details
-
TestSmallCraft
-
-
Method Details
-
legalArmorsFor
Filters all small craft/drop-ship armor according to given tech constraints- Parameters:
techManager
- Used to check the tech constraints- Returns:
- A list of all armors that meet the tech constraints
-
maxArmorPoints
-
maxArmorWeight
Computes the maximum number armor level in tons -
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.Spheroid aft side arcs are implemented as rear-mounted; the return value uses the index of forward side + 3 for the aft side arcs.
- Parameters:
sc
- The small craft/drop-ship 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
-
calculateEngineTonnage
public static double calculateEngineTonnage(boolean clan, double tonnage, int desiredSafeThrust, boolean dropship, int year) Computes the weight of the engine.- Parameters:
clan
- Whether the unit is a Clan designtonnage
- The weight of the unitdesiredSafeThrust
- The safe thrust valuedropship
- Whether the unit is a drop-ship (only relevant for primitives)year
- The original construction year (only relevant for primitives)- Returns:
- The weight of the engine in tons
-
weightFreeHeatSinks
-
smallCraftEngineMultiplier
public static double smallCraftEngineMultiplier(int year) -
smallCraftControlMultiplier
public static double smallCraftControlMultiplier(int year) -
dropshipEngineMultiplier
public static double dropshipEngineMultiplier(int year) -
dropshipControlMultiplier
public static double dropshipControlMultiplier(int year) -
minimumBaseCrew
- Returns:
- Minimum crew requirements based on unit type and equipment crew requirements.
-
getEntity
-
isSmallCraft
public boolean isSmallCraft()- Overrides:
isSmallCraft
in classTestAero
-
getWeightControls
public double getWeightControls()- Overrides:
getWeightControls
in classTestAero
-
getWeightEngine
public double getWeightEngine()- Overrides:
getWeightEngine
in classTestAero
-
printWeightEngine
- Overrides:
printWeightEngine
in classTestEntity
-
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
-
getWeightMisc
public double getWeightMisc()- Overrides:
getWeightMisc
in classTestAero
-
printWeightMisc
- Overrides:
printWeightMisc
in classTestAero
-
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
-
getSmallCraft
-
correctArmor
Checks to see if this unit has valid armor assignment.- Overrides:
correctArmor
in classTestAero
- Parameters:
buff
- A buffer that collects messages about validation failures- Returns:
- Whether the unit's armor is valid
-
correctHeatSinks
Checks that the heatsink type is a legal value.- Overrides:
correctHeatSinks
in classTestAero
- Parameters:
buff
- A buffer that collects messages about validation failures- Returns:
- Whether the unit's heat sinks are valid.
-
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.
-
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
-