Class AlphaStrikeHelper

java.lang.Object
megamek.common.alphaStrike.AlphaStrikeHelper

public class AlphaStrikeHelper extends Object
This class contains static helper methods for AlphaStrike
  • Field Details

  • Method Details

    • getMovementAsString

      public static String getMovementAsString(ASCardDisplayable element)
      Returns a formatted String for the standard movement capability of the given AS element, e.g. 4"/6"j. This includes all movement modes of the element that are typically printed as MV on an AS card. As the only exception, this does not include the a and g movement modes of LandAirMeks, which are printed as special unit abilities.
      Returns:
      A formatted standard movement string, e.g. 4"/6"j.
    • moveString

      public static String moveString(String moveMode, int moveValue, ASCardDisplayable element)
      Returns the formatted String for a single movement mode of the given AS element. E.g., for the move mode "j" and the moveValue 8, returns 8"j.
      Parameters:
      moveMode - The movement mode string, such as "" or "j" or "a"
      moveValue - The movement value, e.g. in inches for ground movement
      element - The AS element (or MekSummary) having the movement mode
      Returns:
      The formatted String for a single movement mode entry, e.g. 4a or 12"j.
    • formatAbility

      public static String formatAbility(BattleForceSUA sua, ASSpecialAbilityCollector collection, @Nullable ASCardDisplayable element, String delimiter)
      Creates the formatted SPA string for the given spa. For turrets this includes everything in that turret. The given collection can be the specials of the AlphaStrikeElement itself, a turret or an arc of a large aerospace unit.
      Parameters:
      sua - The Special Unit Ability to process
      collection - The SUA collection that the SUA is part of
      element - The AlphaStrikeElement that the collection is part of
      delimiter - The delimiter to insert between entries (only relevant for TUR)
      Returns:
      The complete formatted Special Unit Ability string such as "LRM1/1/-" or "CK15D2".
    • hideSpecial

      public static boolean hideSpecial(BattleForceSUA sua, ASCardDisplayable element)
      Returns true if the given Special Unit Ability should be shown on this AS element's card or summary. This is usually true but false for some, e.g. BM automatically have SOA and do not need to show this on the unit card.
      Parameters:
      sua - The Special Unit Ability to check
      Returns:
      True when the given Special Unit Ability should be listed on the element's card
    • hasAutoSeal

      public static boolean hasAutoSeal(ASCardDisplayable element)
      Returns:
      True when this AS element automatically gets the SEAL Special Unit Ability.
    • getSpecialsExportString

      public static String getSpecialsExportString(String delimiter, ASCardDisplayable element)
      Returns:
      A string containing the special abilities of the unit for export (including arcs on large aero units).