Package megamek.common.verifier
Class TestInfantry
java.lang.Object
megamek.common.verifier.TestEntity
megamek.common.verifier.TestInfantry
- All Implemented Interfaces:
TestEntityOption
-
Field Summary
Fields inherited from class megamek.common.verifier.TestEntity
engine, fileString, structureFields inherited from interface megamek.common.verifier.TestEntityOption
CEIL_TARGETING_COMPUTER_CRITS, FLOOR_TARGETING_COMPUTER_CRITS, ROUND_TARGETING_COMPUTER_CRITS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidadaptAntiMekAttacks(Infantry infantry) doubleAccording 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.booleancorrectEntity(StringBuffer buff, int ammoTechLvl) static intfieldGunCrewRequirement(EquipmentType equip, Infantry infantry) Returns the number of troopers of the given infantry required to operate each of the given field gun equipment.intgetName()static doubleCalculates the weight of the given Conventional Infantry unit.doubledoubledoublestatic doublegetWeightExact(Infantry infantry, CalculationReport report) Calculates the weight of the given Conventional Infantry unit.doubledoubledoubledoublebooleanbooleanbooleanisAero()static booleanisFieldArtilleryType(EquipmentType equipmentType) static booleanisFieldArtilleryWeapon(Mounted<?> mounted) booleanisMek()booleanbooleanbooleanisTank()static intstatic intmaxSquadCount(EntityMovementMode movementMode, boolean alt, int specialization, InfantryMount mount) The maximum number of squads in a platoon based on its movement mode.static intmaxSquadSize(EntityMovementMode movementMode, boolean alt, InfantryMount mount) Maximum squad size based on motive typestatic intmaxUnitSize(EntityMovementMode movementMode, boolean alt, boolean engOrMountain, InfantryMount mount) static voidremoveAntiMekAttack(Infantry unit, EquipmentType antiMekType) static voidremoveAntiMekAttacks(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, getTargetingComputerCrits, 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, showUnderweightEntity, skip, totalCritSlotCount, usesKgStandard, validJumpJets
-
Constructor Details
-
TestInfantry
-
-
Method Details
-
getEntity
- Specified by:
getEntityin classTestEntity
-
isTank
public boolean isTank()- Specified by:
isTankin classTestEntity
-
isMek
public boolean isMek()- Specified by:
isMekin classTestEntity
-
isAero
public boolean isAero()- Specified by:
isAeroin classTestEntity
-
isSmallCraft
public boolean isSmallCraft()- Specified by:
isSmallCraftin classTestEntity
-
isAdvancedAerospace
public boolean isAdvancedAerospace()- Specified by:
isAdvancedAerospacein classTestEntity
-
isProtoMek
public boolean isProtoMek()- Specified by:
isProtoMekin classTestEntity
-
getWeightControls
public double getWeightControls()- Specified by:
getWeightControlsin classTestEntity
-
getWeightMisc
public double getWeightMisc()- Specified by:
getWeightMiscin classTestEntity
-
getWeightHeatSinks
public double getWeightHeatSinks()- Specified by:
getWeightHeatSinksin classTestEntity
-
getWeightEngine
public double getWeightEngine()- Overrides:
getWeightEnginein classTestEntity
-
getWeightStructure
public double getWeightStructure()- Overrides:
getWeightStructurein classTestEntity
-
getWeightArmor
public double getWeightArmor()- Overrides:
getWeightArmorin classTestEntity
-
hasDoubleHeatSinks
public boolean hasDoubleHeatSinks()- Specified by:
hasDoubleHeatSinksin classTestEntity
-
getCountHeatSinks
public int getCountHeatSinks()- Specified by:
getCountHeatSinksin classTestEntity
-
printWeightMisc
- Specified by:
printWeightMiscin classTestEntity
-
printWeightControls
- Specified by:
printWeightControlsin classTestEntity
-
printWeightStructure
- Overrides:
printWeightStructurein classTestEntity
-
printWeightArmor
- Overrides:
printWeightArmorin classTestEntity
-
correctEntity
- Specified by:
correctEntityin classTestEntity
-
isFieldArtilleryType
- Returns:
- True if the given equipment type is suitable as a field artillery weapon for a conventional infantry unit; false for a null equipment type.
-
isFieldArtilleryWeapon
- Returns:
- True if the given equipment is suitable as a field artillery weapon for a conventional infantry unit; false for a null equipment.
-
fieldGunCrewRequirement
Returns the number of troopers of the given infantry required to operate each of the given field gun equipment. Neither parameter is checked for correctness. The returned result is never 0.- Parameters:
equip- The weapon type to be used as a field guninfantry- The infantry unit- Returns:
- The troopers required to operate the field gun
-
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.
-
maxSquadCount
public static int maxSquadCount(EntityMovementMode movementMode, boolean alt, int specialization, @Nullable InfantryMount mount) The maximum number of squads in a platoon based on its movement mode.- Parameters:
movementMode- The platoon's movement modealt- True indicates that VTOL is microlite and INF_UMU is motorized.specialization- The infantry's specialization, if any.mount- The mount if the unit is beast-mounted, otherwise null.- Returns:
- The maximum number of squads/creatures per platoon.
-
maxUnitSize
public static int maxUnitSize(EntityMovementMode movementMode, boolean alt, boolean engOrMountain, InfantryMount mount) -
printEntity
- Specified by:
printEntityin classTestEntity
-
printWeightCalculation
- Overrides:
printWeightCalculationin classTestEntity
-
getName
- Specified by:
getNamein classTestEntity
-
getWeightPowerAmp
public double getWeightPowerAmp()- Specified by:
getWeightPowerAmpin classTestEntity
-
calculateWeightExact
public double calculateWeightExact()Description copied from class:TestEntityAccording 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:
calculateWeightExactin 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
-