Package megamek.common.alphaStrike
Class AlphaStrikeHelper
java.lang.Object
megamek.common.alphaStrike.AlphaStrikeHelper
This class contains static helper methods for AlphaStrike
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatAbility(BattleForceSUA sua, ASSpecialAbilityCollector collection, ASCardDisplayable element, String delimiter) Creates the formatted SPA string for the given spa.static StringgetMovementAsString(ASCardDisplayable element) Returns a formatted String for the standard movement capability of the given AS element, e.g.static StringgetSpecialsExportString(String delimiter, ASCardDisplayable element) static booleanhasAutoSeal(ASCardDisplayable element) static booleanhideSpecial(BattleForceSUA sua, ASCardDisplayable element) Returns true if the given Special Unit Ability should be shown on this AS element's card or summary.static StringmoveString(String moveMode, int moveValue, ASCardDisplayable element) Returns the formatted String for a single movement mode of the given AS element.
-
Field Details
-
INCH
- See Also:
-
-
Method Details
-
getMovementAsString
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
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 movementelement- 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 processcollection- The SUA collection that the SUA is part ofelement- The AlphaStrikeElement that the collection is part ofdelimiter- 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
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
- Returns:
- True when this AS element automatically gets the SEAL Special Unit Ability.
-
getSpecialsExportString
- Returns:
- A string containing the special abilities of the unit for export (including arcs on large aero units).
-