Package megamek.common.verifier
Class TestInfantry
java.lang.Object
megamek.common.verifier.TestEntity
megamek.common.verifier.TestInfantry
- All Implemented Interfaces:
TestEntityOption
-
Nested Class Summary
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 void
adaptAntiMekAttacks
(Infantry infantry) 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
correctEntity
(StringBuffer buff, int ammoTechLvl) int
getName()
static double
Calculates the weight of the given Conventional Infantry unit.double
double
double
static double
getWeightExact
(Infantry infantry, CalculationReport report) Calculates the weight of the given Conventional Infantry unit.double
double
double
double
boolean
boolean
boolean
isAero()
boolean
isMek()
boolean
boolean
boolean
isTank()
static int
static int
maxSquadSize
(EntityMovementMode movementMode, boolean alt, InfantryMount mount) Maximum squad size based on motive typestatic int
maxUnitSize
(EntityMovementMode movementMode, boolean alt, boolean engOrMountain, InfantryMount mount) static void
removeAntiMekAttack
(Infantry unit, EquipmentType antiMekType) static void
removeAntiMekAttacks
(Infantry unit) 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, getWeightAmmo, getWeightArmor, getWeightCarryingSpace, getWeightCeilingArmor, getWeightCeilingControls, getWeightCeilingEngine, getWeightCeilingGyro, getWeightCeilingLifting, getWeightCeilingPowerAmp, getWeightCeilingStructure, getWeightCeilingTargComp, getWeightCeilingTurret, getWeightCeilingWeapons, getWeightMiscEquip, getWeightWeapon, hasFailedEquipment, hasIllegalEquipmentCombinations, hasIllegalTechLevels, hasIllegalTechLevels, hasIncorrectIntroYear, heatNeutralHSRequirement, ignoreFailedEquip, includeMiscEquip, isClan, isClanArmor, isValidLocation, legalArmorsFor, printAmmo, printAmmo, printAmmo, printArmorLocation, printArmorPlacement, printFailedEquipment, printLocations, printMiscEquip, printMiscEquip, printMiscEquip, printShortMovement, printSource, printTechLevel, printWeapon, printWeapon, printWeapon, printWeightCarryingSpace, printWeightEngine, printWeightHeatSinks, round, setPrecision, showCorrectArmor, showCorrectCritical, showFailedEquip, showIncorrectIntroYear, showOverweightedEntity, showUnderweightedEntity, skip, totalCritSlotCount, usesKgStandard, validJumpJets
-
Constructor Details
-
TestInfantry
-
-
Method Details
-
getEntity
- Specified by:
getEntity
in classTestEntity
-
isTank
public boolean isTank()- Specified by:
isTank
in classTestEntity
-
isMek
public boolean isMek()- Specified by:
isMek
in classTestEntity
-
isAero
public boolean isAero()- Specified by:
isAero
in classTestEntity
-
isSmallCraft
public boolean isSmallCraft()- Specified by:
isSmallCraft
in classTestEntity
-
isAdvancedAerospace
public boolean isAdvancedAerospace()- Specified by:
isAdvancedAerospace
in classTestEntity
-
isProtoMek
public boolean isProtoMek()- Specified by:
isProtoMek
in classTestEntity
-
getWeightControls
public double getWeightControls()- Specified by:
getWeightControls
in classTestEntity
-
getWeightMisc
public double getWeightMisc()- Specified by:
getWeightMisc
in classTestEntity
-
getWeightHeatSinks
public double getWeightHeatSinks()- Specified by:
getWeightHeatSinks
in classTestEntity
-
getWeightEngine
public double getWeightEngine()- Overrides:
getWeightEngine
in classTestEntity
-
getWeightStructure
public double getWeightStructure()- Overrides:
getWeightStructure
in classTestEntity
-
getWeightArmor
public double getWeightArmor()- Overrides:
getWeightArmor
in classTestEntity
-
hasDoubleHeatSinks
public boolean hasDoubleHeatSinks()- Specified by:
hasDoubleHeatSinks
in classTestEntity
-
getCountHeatSinks
public int getCountHeatSinks()- Specified by:
getCountHeatSinks
in classTestEntity
-
printWeightMisc
- Specified by:
printWeightMisc
in classTestEntity
-
printWeightControls
- Specified by:
printWeightControls
in classTestEntity
-
printWeightStructure
- Overrides:
printWeightStructure
in classTestEntity
-
printWeightArmor
- Overrides:
printWeightArmor
in classTestEntity
-
correctEntity
- Specified by:
correctEntity
in classTestEntity
-
maxSecondaryWeapons
-
maxSquadSize
public static int maxSquadSize(EntityMovementMode movementMode, boolean alt, @Nullable InfantryMount mount) Maximum squad size based on motive type- Parameters:
movementMode
- The platoon's movement modealt
- True indicates that VTOL is microlite and INF_UMU is motorized.mount
- The mount if the unit is beast-mounted, otherwise null.- Returns:
- The maximum size of a squad.
-
maxUnitSize
public static int maxUnitSize(EntityMovementMode movementMode, boolean alt, boolean engOrMountain, InfantryMount mount) -
printEntity
- Specified by:
printEntity
in classTestEntity
-
printWeightCalculation
- Overrides:
printWeightCalculation
in classTestEntity
-
getName
- Specified by:
getName
in classTestEntity
-
getWeightPowerAmp
public double getWeightPowerAmp()- Specified by:
getWeightPowerAmp
in classTestEntity
-
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 classTestEntity
- Returns:
- The unrounded weight of the unit.
-
getWeight
Calculates the weight of the given Conventional Infantry unit. Infantry weight is not fixed as in Meks and Vehicles but calculated from the infantry configuration.- Parameters:
infantry
- The conventional infantry- Returns:
- The rounded weight in tons
-
getWeightExact
Calculates the weight of the given Conventional Infantry unit. Infantry weight is not fixed as in Meks and Vehicles but calculated from the infantry configuration. The given CalculationReport will be filled in with the weight calculation (the report includes the final rounding step but the returned result does not).- Parameters:
infantry
- The conventional infantryreport
- A CalculationReport to fill in- Returns:
- The exact weight in tons
-
adaptAntiMekAttacks
-
removeAntiMekAttacks
-
removeAntiMekAttack
-