Class ASConverter

java.lang.Object
megamek.common.alphaStrike.conversion.ASConverter

public final class ASConverter extends Object
Static AlphaStrike Conversion class; contains all information for conversion except for some weapon specifics handled in WeaponType/AmmoType/MiscType.
  • Method Details

    • convertForMekCache

      public static AlphaStrikeElement convertForMekCache(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).
    • convertInMML

      public static AlphaStrikeElement convertInMML(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).
    • convert

      public static AlphaStrikeElement convert(Entity entity, CalculationReport conversionReport)
    • convert

      public static AlphaStrikeElement convert(Entity entity)
    • convert

      public static AlphaStrikeElement convert(Entity entity, boolean includePilot)
    • convert

      public static AlphaStrikeElement convert(Entity entity, boolean includePilot, CalculationReport conversionReport)
    • canConvert

      public static boolean canConvert(@Nullable Entity entity)
      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

      @Nullable public static Entity getUndamagedEntity(Entity entity)
      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

      public static int toInt(ASArcs arc)
    • updateCalculatedValues

      public static void updateCalculatedValues(AlphaStrikeElement element)
      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.