Package megamek.common.verifier
Class TestSupportVehicle
java.lang.Object
megamek.common.verifier.TestEntity
megamek.common.verifier.TestSupportVehicle
- All Implemented Interfaces:
TestEntityOption
Author: arlith
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAdditional construction data for chassis mods, used to determine whether they are legal for particular units.static enumAdditional construction data for engine types, used to determine which ones are available for which vehicle types.static enumSupport vehicle categories for construction purposes. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final TechAdvancement[]Tech advancement data for structural components with variable tech levels (structure, armor, engine).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
ConstructorsConstructorDescriptionTestSupportVehicle(Entity supportVehicle, TestEntityOption options, String fileString) -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleCalculates the weight of each point of armor.doubleAccording to TM, unit weights are to be rounded up to the nearest half ton or kilo.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.booleanbooleanbooleanbooleancorrectEntity(StringBuffer buff, int ammoTechLvl) static int[]extraCrewQuartersCount(Entity supportVehicle) Calculates capacity of quarters above the minimum crew requirement.intintintintCalculates the number of equipment slots taken up by crew quarters.doubleintgetName()static doublegetSmallSVAmmoWeight(Mounted<?> mounted) doubledoubleintEach distinct bay requires a slot, regardless of size.intdoubledoubledoubledoubledoubledoubledoublebooleanbooleanCheck if the unit has combinations of equipment which are not allowed in the construction rules.protected booleanGives subclasses a chance to exclude certain misc equipment if it is accounted for in a different category.booleanbooleanisAero()booleanisMek()booleanbooleanstatic booleanisSmallSupportVehicle(Entity entity) static booleanbooleanisTank()legalArmorsFor(ITechManager techManager) Filters all vehicle armor according to given tech constraints.static intmaxArmorFactor(Entity vee) The maximum number of armor points a support vehicle is computed by multiplying the total tonnage by a factor determined by the vehicle type and adding four.intstatic booleanpintleLegal(TestSupportVehicle.SVType type, boolean small) Checks whether the support vehicle can mount pintle turrets (TM, p.printAmmo(StringBuffer buff, int posLoc, int posWeight) static booleansponsonLegal(TestSupportVehicle.SVType type, boolean small) Checks whether the support vehicle can mount sponson turrets (TO, p.intMethods inherited from class megamek.common.verifier.TestEntity
calcHeatNeutralHSRequirement, calcMiscCrits, ceil, ceilMaxHalf, correctArmorOverAllocation, correctEntity, correctWeight, correctWeight, eqRequiresLocation, equipmentCrewRequirements, floor, getArmoredComponentWeight, getArmorPoints, getArmorPoints, getArmorPointsPerTon, getEntityVerifier, getGameYear, getIntroYearMargin, getLocationAbbr, getMaximumArmorPoints, getMaxOverweight, getMinUnderweight, getMPBoosters, getPrintSize, getRawArmorPoints, getRawWeightArmor, getSIBonusArmorPoints, getSystemWideLocation, getTargetingComputerCrits, getTotalOArmor, getWeight, getWeightAllocatedArmor, getWeightArmor, getWeightCarryingSpace, getWeightCeilingArmor, getWeightCeilingControls, getWeightCeilingEngine, getWeightCeilingGyro, getWeightCeilingLifting, getWeightCeilingPowerAmp, getWeightCeilingStructure, getWeightCeilingTargComp, getWeightCeilingTurret, getWeightCeilingWeapons, getWeightEngine, getWeightMiscEquip, getWeightWeapon, hasFailedEquipment, hasIllegalTechLevels, hasIllegalTechLevels, hasIncorrectIntroYear, heatNeutralHSRequirement, ignoreFailedEquip, isClan, isClanArmor, isValidLocation, isWeightCorrect, legalArmorsFor, printAmmo, printAmmo, printArmorLocation, printArmorPlacement, printFailedEquipment, printLocations, printMiscEquip, printMiscEquip, printMiscEquip, printShortMovement, printSource, printTechLevel, printWeapon, printWeapon, printWeapon, printWeightCalculation, printWeightCarryingSpace, printWeightHeatSinks, round, setGameYear, setPrecision, showCorrectArmor, showCorrectCritical, showFailedEquip, showIncorrectIntroYear, showOverweightedEntity, showUnderweightEntity, skip, totalCritSlotCount, usesKgStandard, validJumpJets
-
Field Details
-
TECH_LEVEL_TA
Tech advancement data for structural components with variable tech levels (structure, armor, engine). This is assembled from the table on TM, p. 122 and IO, p. 49, primitive construction rules (IO, p. 120-121) and a pending proposal to the rules committee for E. -
INDEX_FIRST_CLASS
public static final int INDEX_FIRST_CLASS- See Also:
-
INDEX_SECOND_CLASS
public static final int INDEX_SECOND_CLASS- See Also:
-
INDEX_STD_CREW
public static final int INDEX_STD_CREW- See Also:
-
INDEX_STEERAGE
public static final int INDEX_STEERAGE- See Also:
-
-
Constructor Details
-
TestSupportVehicle
-
-
Method Details
-
legalArmorsFor
Filters all vehicle armor according to given tech constraints. Standard armor is treated as basic support vehicle armor.- Parameters:
techManager- Applies the filtering criteria- Returns:
- A list of armor equipment that meets the tech constraints
-
maxArmorFactor
The maximum number of armor points a support vehicle is computed by multiplying the total tonnage by a factor determined by the vehicle type and adding four.- Parameters:
vee- The support vehicle- Returns:
- The maximum number of armor points. If the entity cannot be identified as a support vehicle, returns 0.
-
armorWeightPerPoint
Calculates the weight of each point of armor. For standard SV armor this is based on the tech and BAR ratings. For advanced armors this is the reciprocal of the number of points per ton.- Parameters:
vee- The support vehicle- Returns:
- The weight of each armor point in tons, rounded to the kilogram.
-
sponsonLegal
Checks whether the support vehicle can mount sponson turrets (TO, p. 348)- Parameters:
type- The support vehicle typesmall- Whether theEntityis a small support vehicle- Returns:
- Whether the vehicle can use sponson turrets.
-
pintleLegal
Checks whether the support vehicle can mount pintle turrets (TM, p. 348)- Parameters:
type- The support vehicle typesmall- Whether theEntityis a small support vehicle- Returns:
- Whether the vehicle can use pintle turrets.
-
printWeightStructure
- Overrides:
printWeightStructurein classTestEntity
-
printWeightEngine
- Overrides:
printWeightEnginein classTestEntity
-
printWeightArmor
- Overrides:
printWeightArmorin classTestEntity
-
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
-
calculateWeight
public double calculateWeight()Description copied from class:TestEntityAccording to TM, unit weights are to be rounded up to the nearest half ton or kilo. This method returns the rounded weight.- Overrides:
calculateWeightin classTestEntity- Returns:
- The weight of the unit, rounded up according to TM, p.22.
-
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.
-
getWeightStructure
public double getWeightStructure()- Overrides:
getWeightStructurein classTestEntity
-
getFuelTonnage
public double getFuelTonnage() -
getWeightControls
public double getWeightControls()- Specified by:
getWeightControlsin classTestEntity
-
getWeightMisc
public double getWeightMisc()- Specified by:
getWeightMiscin classTestEntity
-
getTankWeightTurret
public double getTankWeightTurret() -
getTankWeightDualTurret
public double getTankWeightDualTurret() -
getWeightAmmo
public double getWeightAmmo()- Overrides:
getWeightAmmoin classTestEntity
-
getWeightPowerAmp
public double getWeightPowerAmp()- Specified by:
getWeightPowerAmpin classTestEntity
-
includeMiscEquip
Description copied from class:TestEntityGives subclasses a chance to exclude certain misc equipment if it is accounted for in a different category.- Overrides:
includeMiscEquipin classTestEntity- Parameters:
eq- The misc equipment type- Returns:
- Whether to include the equipment in the misc equipment category
- See Also:
-
getWeightHeatSinks
public double getWeightHeatSinks()- Specified by:
getWeightHeatSinksin 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
-
printAmmo
- Overrides:
printAmmoin classTestEntity
-
getSmallSVAmmoWeight
-
canUseSponsonTurret
public boolean canUseSponsonTurret() -
canUsePintleTurret
public boolean canUsePintleTurret() -
correctEntity
- Specified by:
correctEntityin classTestEntity
-
isSmallSupportVehicle
-
isSmallSupportVehicleWeapon
-
hasIllegalEquipmentCombinations
Description copied from class:TestEntityCheck if the unit has combinations of equipment which are not allowed in the construction rules.- Overrides:
hasIllegalEquipmentCombinationsin classTestEntity- Parameters:
buffer- diagnostics are appended to this- Returns:
- true if the entity is illegal
-
correctCriticalSlots
-
printEntity
- Specified by:
printEntityin classTestEntity
-
printSlotCalculation
-
getName
- Specified by:
getNamein classTestEntity
-
getWeightArmor
public double getWeightArmor()- Overrides:
getWeightArmorin classTestEntity
-
totalSlotCount
public int totalSlotCount()- Returns:
- The total slot space
-
occupiedSlotCount
public int occupiedSlotCount()- Returns:
- The number of slots taken up by installed equipment
-
getArmorSlots
public int getArmorSlots()- Returns:
- The number of slots taken up by armor
-
getWeaponSlots
public int getWeaponSlots()- Returns:
- The number of slots taken up by weapons
-
getAmmoSlots
public int getAmmoSlots()- Returns:
- The number of slots taken up by ammo.
-
getMiscEquipSlots
public int getMiscEquipSlots()- Returns:
- The number of slots taken by miscellaneous equipment.
-
extraCrewQuartersCount
Calculates capacity of quarters above the minimum crew requirement. Only quarters above the minimum crew requirement take up equipment slots. Second class quarters are considered passenger accommodations and always count toward slots. Others are assigned to the least bulky type first.- Parameters:
supportVehicle- A support vehicle- Returns:
- An array of the count of each type of quarters that require slots. See INDEX_* constants for indices.
-
getCrewSlots
public int getCrewSlots()Calculates the number of equipment slots taken up by crew quarters. Quarters for minimum crew do not take up slots.- Returns:
- The number of equipment slots required by crew quarters.
-
getTransportSlots
public int getTransportSlots()Each distinct bay requires a slot, regardless of size. AllInfantryCompartmentis treated as a single bay.- Returns:
- The number of slots required by transporters.
-