Class ASConverter
java.lang.Object
megamek.common.alphaStrike.conversion.ASConverter
Static AlphaStrike Conversion class; contains all information for conversion except for some weapon specifics handled
in WeaponType/AmmoType/MiscType.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanConvert(Entity entity) Returns true if the given entity can be converted to AlphaStrike.static AlphaStrikeElementstatic AlphaStrikeElementstatic AlphaStrikeElementconvert(Entity entity, boolean includePilot, CalculationReport conversionReport) static AlphaStrikeElementconvert(Entity entity, CalculationReport conversionReport) static AlphaStrikeElementconvertForMekCache(Entity entity) Performs Alpha Strike conversion for the MekSummaryCache (without trying to get a clean unit first, without storing a conversion report and without considering pilot skill).static AlphaStrikeElementconvertInMML(Entity entity, CalculationReport report) Performs Alpha Strike conversion for use in MML (without trying to get a clean unit first, without considering pilot skill but with storing a conversion report).static EntitygetUndamagedEntity(Entity entity) static introundUp(double number) Returns the given number, rounded up to the nearest integer, based on the first decimal only.static intstatic voidupdateCalculatedValues(AlphaStrikeElement element) Re-calculates those values of the element that are purely calculated from its other values without needing the original TW unit.
-
Method Details
-
convertForMekCache
Performs Alpha Strike conversion for the MekSummaryCache (without trying to get a clean unit first, without storing a conversion report and without considering pilot skill). -
convertInMML
Performs Alpha Strike conversion for use in MML (without trying to get a clean unit first, without considering pilot skill but with storing a conversion report). -
convert
-
convert
-
convert
-
convert
public static AlphaStrikeElement convert(Entity entity, boolean includePilot, CalculationReport conversionReport) -
canConvert
Returns true if the given entity can be converted to AlphaStrike. This is only false for entities of some special types such as TeleMissile. GunEmplacement is being allowed conversion as of 50.02 even though it's not currently officially supported in rules as written, but it generates a valid unit that can be used in auto-resolution and other parts of the game. (Luana Coppio) Also returns false if entity is null. -
getUndamagedEntity
- Returns:
- Retrieves a fresh (undamaged and unmodified) copy of the given entity.
-
roundUp
public static int roundUp(double number) Returns the given number, rounded up to the nearest integer, based on the first decimal only. -
toInt
-
updateCalculatedValues
Re-calculates those values of the element that are purely calculated from its other values without needing the original TW unit. These are TMM, threshold and PV. May be used e.g. after deserialization.
-