Package megamek.common.alphaStrike
Interface ASSpecialAbilityCollector
- All Known Implementing Classes:
AlphaStrikeElement
,ASArcSummary
,ASSpecialAbilityCollection
,ASTurretSummary
,Formation
,SBFFormation
,SBFUnit
public interface ASSpecialAbilityCollector
This interface is implemented by classes that represent anything that holds AlphaStrike Special
Unit Abilities. This is the AlphaStrike element itself (its central abilities such as MHQ, CK23-D2 or
ARM). It is also implemented by the ASSpecialAbilityCollection (and subclasses) that represent the
abilities inside the TUR special as well as the abilities and damage of a large aero's arcs.
The interface contains various methods to retrieve the abilities in a type-safe and convenient way.
The default methods should be correct and not be overridden in implementing classes.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ASDamageVector
getAC()
getBIM()
default ASDamageVector
getCAP()
default int
getCAR()
default double
getCT()
default ASDamageVector
getFLK()
default int
getFUEL()
default ASDamageVector
getHT()
default ASDamageVector
getIATM()
default ASDamage
getIF()
default double
getIT()
default int
getJMPS()
getLAM()
default ASDamageVector
getLRM()
default int
getMHQ()
default ASDamageVector
getMSL()
default ASDamageVector
getREAR()
default ASDamageVector
getSCAP()
getSpecialsDisplayString
(String delimiter, BattleForceSUAFormatter element) Returns a formatted SUA string suitable for gameplay display such as on an AS Card.default String
Returns a formatted SUA string for this AS element.default ASDamageVector
getSRM()
default ASDamageVector
getSUA
(BattleForceSUA sua) default int
getSUBS()
default ASDamageVector
getTOR()
default ASTurretSummary
getTUR()
default boolean
hasAnySUAOf
(BattleForceSUA sua, BattleForceSUA... furtherSuas) Returns true when this element, turret or arc has any of the given Special Unit Abilities.boolean
hasSUA
(BattleForceSUA sua) Returns true when the element, turret or arc has the given Special Unit Ability.
-
Method Details
-
hasSUA
Returns true when the element, turret or arc has the given Special Unit Ability. When it has and the SUA is associated with some value, this value can be assumed to be non-empty or greater than zero. For example, if an element has MHQ, then MHQ >= 1. If it has IF, then the IF damage is at least 0*.- Parameters:
sua
- The Special Unit Ability to check- Returns:
- True when the given Special Unit Ability is present
-
hasAnySUAOf
Returns true when this element, turret or arc has any of the given Special Unit Abilities. SeehasSUA(BattleForceSUA)
- Parameters:
sua
- The Special Unit Ability to check- Returns:
- True when this AS element has the given Special Unit Ability
-
getSUA
- Returns:
- The value associated with the given Special Unit Ability. Depending on the given sua, this value can be null or of different types. Preferably use the type-safe specific methods such as getLRM() instead of this method.
-
getSpecialsDisplayString
Returns a formatted SUA string for this AS element. The string is formatted in the way SUAs are printed on an AS element's card or summary with a ', ' between SUAs.- Returns:
- A formatted Special Unit Ability string
-
getSpecialsDisplayString
Returns a formatted SUA string suitable for gameplay display such as on an AS Card. The given delimiter is inserted between SUAs.- Returns:
- A formatted Special Unit Ability string
-
getIF
- Returns:
- The IF ability value of this collection or
ASDamage.ZERO
, if there is no IF.
-
getLRM
- Returns:
- The LRM ability value of this collection or
ASDamageVector.ZEROSPECIAL
, if there is no LRM.
-
getIATM
- Returns:
- The IATM ability value of this collection or
ASDamageVector.ZEROSPECIAL
, if there is no IATM.
-
getREAR
- Returns:
- The REAR ability value of this collection or
ASDamageVector.ZEROSPECIAL
, if there is no REAR.
-
getAC
- Returns:
- The AC ability value of this collection or
ASDamageVector.ZEROSPECIAL
, if there is no AC.
-
getSRM
- Returns:
- The SRM ability value of this collection or
ASDamageVector.ZEROSPECIAL
, if there is no SRM.
-
getTOR
- Returns:
- The TOR ability value of this collection or
ASDamageVector.ZEROSPECIAL
, if there is no TOR.
-
getHT
- Returns:
- The HT ability value of this collection or
ASDamageVector.ZEROSPECIAL
, if there is no HT.
-
getFLK
- Returns:
- The FLK ability value of this collection or
ASDamageVector.ZEROSPECIAL
, if there is no FLK.
-
getTUR
- Returns:
- The TUR contents of this element (empty if there is no TUR).
-
getLAM
- Returns:
- The Map that contains the element's LAM movement ability (or an empty map).
-
getBIM
- Returns:
- The Map that contains the element's BIM movement ability (or an empty map).
-
getMHQ
default int getMHQ()- Returns:
- The MHQ ability value of this element or 0 if it doesn't have MHQ.
-
getJMPS
default int getJMPS()- Returns:
- The JPMS ability value of this element or 0 if it doesn't have JMPS.
-
getSUBS
default int getSUBS()- Returns:
- The SUBS ability value of this element or 0 if it doesn't have SUBS.
-
getFUEL
default int getFUEL()- Returns:
- The FUEL ability value of this element or 0 if it doesn't have FUEL.
-
getStdDamage
- Returns:
- The standard damage of this element or turret or the STD damage of this arc.
-
getCAP
- Returns:
- The capital weapon (CAP) damage of this arc.
-
getSCAP
- Returns:
- The sub-capital weapon (SCAP) damage of this arc.
-
getMSL
- Returns:
- The capital missile weapon (MSL) damage of this arc.
-
getCT
default double getCT()- Returns:
- The CT transport ability value of this element or 0 if it doesn't have CT.
-
getIT
default double getIT()- Returns:
- The IT transport ability value of this element or 0 if it doesn't have IT.
-
getCAR
default int getCAR()- Returns:
- The CAR ability value of this element or 0 if it doesn't have CAR.
-