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 SummaryNested classes/interfaces inherited from class megamek.common.verifier.TestAeroTestAero.Quarters
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class megamek.common.verifier.TestEntityengine, fileString, structureFields inherited from interface megamek.common.verifier.TestEntityOptionCEIL_TARGETING_COMPUTER_CRITS, FLOOR_TARGETING_COMPUTER_CRITS, ROUND_TARGETING_COMPUTER_CRITS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic doublecalculateEngineTonnage(boolean clan, double tonnage, int desiredSafeThrust, boolean dropship, int year) Computes the weight of the engine.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.booleancorrectArmor(StringBuffer buff) Checks to see if this unit has valid armor assignment.booleancorrectCrew(StringBuffer buffer) Checks that the unit meets minimum crew and quarters requirements.booleancorrectEntity(StringBuffer buff, int ammoTechLvl) booleancorrectHeatSinks(StringBuffer buff) Checks that the heatsink type is a legal value.static doubledropshipControlMultiplier(int year) static doubledropshipEngineMultiplier(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()intgetName()doubledoubledoubledoubledoubledoublebooleanbooleanCheck if the unit has combinations of equipment which are not allowed in the construction rules.booleanlegalArmorsFor(ITechManager techManager) Filters all small craft/drop-ship armor according to given tech constraintsstatic intstatic doublemaxArmorWeight(SmallCraft smallCraft) Computes the maximum number armor level in tonsstatic intstatic doublesmallCraftControlMultiplier(int year) static doublesmallCraftEngineMultiplier(int year) static intMethods inherited from class megamek.common.verifier.TestAeroavailableSpace, calculateDaysAt1G, calculateDaysAtMax, calculateEngineRating, checkCriticalSlotsForEquipment, correctControlSystems, correctCriticalSlots, eqRequiresLocation, getMaxTonnage, getPrimitiveDropshipMaxTonnage, getPrimitiveJumpshipMaxTonnage, getWeightMiscEquip, getWeightPowerAmp, getWeightQuarters, getWeightStructure, hasMismatchedLateralWeapons, isAdvancedAerospace, isAero, isAeroWeapon, isMek, isProtoMek, isTank, isValidAeroLocation, maxArmorPoints, maxBayDoors, minimumBaseCrew, printArmorLocProp, printWeightQuarters, requiredGunners, slotsPerArc, usesWeaponSlot, weightFreeHeatSinksMethods inherited from class megamek.common.verifier.TestEntitycalcHeatNeutralHSRequirement, 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, 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, showUnderweightEntity, skip, totalCritSlotCount, usesKgStandard, validJumpJets
- 
Field Details- 
ARC_NOSEpublic static final int ARC_NOSE- See Also:
 
- 
ARC_LEFT_WINGpublic static final int ARC_LEFT_WING- See Also:
 
- 
ARC_RIGHT_WINGpublic static final int ARC_RIGHT_WING- See Also:
 
- 
ARC_AFTpublic static final int ARC_AFT- See Also:
 
- 
REAR_ARC_OFFSETpublic static final int REAR_ARC_OFFSET- See Also:
 
- 
ARC_FWD_LEFTpublic static final int ARC_FWD_LEFT- See Also:
 
- 
ARC_FWD_RIGHTpublic static final int ARC_FWD_RIGHT- See Also:
 
- 
ARC_AFT_LEFTpublic static final int ARC_AFT_LEFT- See Also:
 
- 
ARC_AFT_RIGHTpublic static final int ARC_AFT_RIGHT- See Also:
 
 
- 
- 
Constructor Details- 
TestSmallCraft
 
- 
- 
Method Details- 
legalArmorsForFilters 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
- 
maxArmorWeightComputes the maximum number armor level in tons
- 
extraSlotCostComputes 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 doublearray, where each element corresponds to a location and the value is the extra tonnage required by exceeding the base allotment
 
- 
calculateEngineTonnagepublic 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 design
- tonnage- The weight of the unit
- desiredSafeThrust- The safe thrust value
- dropship- 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
- 
smallCraftEngineMultiplierpublic static double smallCraftEngineMultiplier(int year) 
- 
smallCraftControlMultiplierpublic static double smallCraftControlMultiplier(int year) 
- 
dropshipEngineMultiplierpublic static double dropshipEngineMultiplier(int year) 
- 
dropshipControlMultiplierpublic static double dropshipControlMultiplier(int year) 
- 
minimumBaseCrew- Returns:
- Minimum crew requirements based on unit type and equipment crew requirements.
 
- 
getEntity
- 
isSmallCraftpublic boolean isSmallCraft()- Overrides:
- isSmallCraftin class- TestAero
 
- 
getWeightControlspublic double getWeightControls()- Overrides:
- getWeightControlsin class- TestAero
 
- 
getWeightEnginepublic double getWeightEngine()- Overrides:
- getWeightEnginein class- TestAero
 
- 
printWeightEngine- Overrides:
- printWeightEnginein class- TestEntity
 
- 
getWeightFuelpublic double getWeightFuel()- Overrides:
- getWeightFuelin class- TestAero
 
- 
getCountHeatSinkspublic int getCountHeatSinks()- Overrides:
- getCountHeatSinksin class- TestAero
 
- 
getWeightHeatSinkspublic double getWeightHeatSinks()- Overrides:
- getWeightHeatSinksin class- TestAero
 
- 
getWeightAmmopublic double getWeightAmmo()- Overrides:
- getWeightAmmoin class- TestEntity
 
- 
getWeightMiscpublic double getWeightMisc()- Overrides:
- getWeightMiscin class- TestAero
 
- 
printWeightMisc- Overrides:
- printWeightMiscin class- TestAero
 
- 
printWeapon- Overrides:
- printWeaponin class- TestEntity
 
- 
printAmmo- Overrides:
- printAmmoin class- TestEntity
 
- 
hasDoubleHeatSinkspublic boolean hasDoubleHeatSinks()- Overrides:
- hasDoubleHeatSinksin class- TestAero
 
- 
printWeightControls- Overrides:
- printWeightControlsin class- TestAero
 
- 
printWeightFuel- Overrides:
- printWeightFuelin class- TestAero
 
- 
getAero
- 
getSmallCraft
- 
correctArmorChecks to see if this unit has valid armor assignment.- Overrides:
- correctArmorin class- TestAero
- Parameters:
- buff- A buffer that collects messages about validation failures
- Returns:
- Whether the unit's armor is valid
 
- 
correctHeatSinksChecks that the heatsink type is a legal value.- Overrides:
- correctHeatSinksin class- TestAero
- Parameters:
- buff- A buffer that collects messages about validation failures
- Returns:
- Whether the unit's heat sinks are valid.
 
- 
correctEntity- Overrides:
- correctEntityin class- TestAero
 
- 
hasIllegalEquipmentCombinationsDescription copied from class:TestEntityCheck if the unit has combinations of equipment which are not allowed in the construction rules.- Overrides:
- hasIllegalEquipmentCombinationsin class- TestEntity
- Parameters:
- buff- diagnostics are appended to this
- Returns:
- true if the entity is illegal
 
- 
correctCrewChecks 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:
- printEntityin class- TestAero
 
- 
calculateWeightExactpublic 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 class- TestAero
- Returns:
- The unrounded weight of the unit.
 
- 
printWeightCalculation- Overrides:
- printWeightCalculationin class- TestAero
 
- 
printLocations- Overrides:
- printLocationsin class- TestAero
 
- 
getName
 
-