Class SBFUnit
java.lang.Object
megamek.common.strategicBattleSystems.SBFUnit
- All Implemented Interfaces:
Serializable,ASSpecialAbilityCollector,BattleForceSUAFormatter
public class SBFUnit
extends Object
implements ASSpecialAbilityCollector, BattleForceSUAFormatter, Serializable
Represents an SBF Unit (Ground SBF Unit or Aerospace Flight) which contains between 1 and 6 AlphaStrike elements and
is the building block of SBF Formations.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidDeprecated, for removal: This API element is subject to removal in a future version.voidformatSUA(BattleForceSUA sua, String delimiter, ASSpecialAbilityCollector collection) Returns the formatted SUA string for the given sua.intgetArmor()intDeprecated, for removal: This API element is subject to removal in a future version.intintintintintgetName()intintgetSize()intgetSkill()getSpecialsDisplayString(String delimiter, BattleForceSUAFormatter element) Returns a formatted SUA string suitable for gameplay display such as on an AS Card.getSUA(BattleForceSUA sua) intintgetTmm()intgetType()booleanbooleanhasSUA(BattleForceSUA sua) Returns true when the element, turret or arc has the given Special Unit Ability.booleanReturns true if this SBF Unit represents an aerospace Unit.booleanisAnyTypeOf(SBFElementType type, SBFElementType... types) Returns true if this SBF Unit is any of the given types.booleanisGround()Returns true if this SBF Unit represents a ground Unit.booleanisType(SBFElementType tp) Returns true if this SBF Unit is of the given type.voidsetArmor(int armor) Sets the full (undamaged) armor of this SBF Unit.voidsetCurrentArmor(int currentArmor) voidsetDamage(ASDamageVector damage) voidsetElements(List<AlphaStrikeElement> elements) voidsetJumpMove(int jumpMove) voidsetMovement(int movement) voidvoidvoidsetPointValue(int pointValue) voidsetSize(int size) voidsetSkill(int skill) voidsetTmm(int tmm) voidsetTrspMovement(int trspMovement) voidvoidsetType(SBFElementType type) booleanshowSUA(BattleForceSUA sua) Returns true when this object wants to have the given SUA displayed among its special abilities.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface megamek.common.alphaStrike.ASSpecialAbilityCollector
getAC, getBIM, getCAP, getCAR, getCT, getFLK, getFUEL, getHT, getIATM, getIF, getIT, getJMPS, getLAM, getLRM, getMHQ, getMSL, getREAR, getSCAP, getSpecialsDisplayString, getSRM, getStdDamage, getSUBS, getTOR, getTUR, hasAnySUAOf
-
Constructor Details
-
SBFUnit
public SBFUnit()
-
-
Method Details
-
getName
-
setName
-
getType
-
setType
-
getSize
public int getSize() -
setSize
public void setSize(int size) -
getTmm
public int getTmm() -
setTmm
public void setTmm(int tmm) -
getMovement
public int getMovement() -
setMovement
public void setMovement(int movement) -
getTrspMovement
public int getTrspMovement() -
setTrspMovement
public void setTrspMovement(int trspMovement) -
getTrspMovementCode
-
getTrspMovementMode
-
setTrspMovementMode
-
getMovementCode
-
getMovementMode
-
setMovementMode
-
getJumpMove
public int getJumpMove() -
setJumpMove
public void setJumpMove(int jumpMove) -
getSkill
public int getSkill() -
setSkill
public void setSkill(int skill) -
getPointValue
public int getPointValue() -
setPointValue
public void setPointValue(int pointValue) -
getArmor
public int getArmor() -
setArmor
public void setArmor(int armor) Sets the full (undamaged) armor of this SBF Unit. Also sets the current armor to the same value.- Parameters:
armor- The full undamaged armor of this Unit
-
getCurrentArmor
public int getCurrentArmor()- Returns:
- The current armor of this Unit, which is any value between the full (undamaged) armor and 0.
-
getDamage
-
getCurrentDamage
-
setDamage
-
setElements
-
getElements
-
getSpecialAbilities
-
isType
Returns true if this SBF Unit is of the given type. -
isAnyTypeOf
Returns true if this SBF Unit is any of the given types. -
isAerospace
public boolean isAerospace()Returns true if this SBF Unit represents an aerospace Unit. -
isGround
public boolean isGround()Returns true if this SBF Unit represents a ground Unit. -
hasSUA
Description copied from interface:ASSpecialAbilityCollectorReturns 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*.- Specified by:
hasSUAin interfaceASSpecialAbilityCollector- Parameters:
sua- The Special Unit Ability to check- Returns:
- True when the given Special Unit Ability is present
-
getSUA
- Specified by:
getSUAin interfaceASSpecialAbilityCollector- 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
Description copied from interface:ASSpecialAbilityCollectorReturns a formatted SUA string suitable for gameplay display such as on an AS Card. The given delimiter is inserted between SUAs.- Specified by:
getSpecialsDisplayStringin interfaceASSpecialAbilityCollector- Returns:
- A formatted Special Unit Ability string
-
showSUA
Description copied from interface:BattleForceSUAFormatterReturns true when this object wants to have the given SUA displayed among its special abilities. This method defaults to returning true and must be overridden when some SUAs are not too displayed.- Specified by:
showSUAin interfaceBattleForceSUAFormatter- Returns:
- True when this object wants to have the given sua displayed among its special abilities.
-
formatSUA
Description copied from interface:BattleForceSUAFormatterReturns the formatted SUA string for the given sua. The given collection can be the specials of the AlphaStrikeElement itself, a turret or an arc of a large aerospace unit. It is required to access related SUAs such as the doors for a transport ability like MT.- Specified by:
formatSUAin interfaceBattleForceSUAFormatter- Parameters:
sua- The Special Unit Ability to processdelimiter- The delimiter to insert between entries (only relevant for TUR)collection- The SUA collection that the given SUA is part of- Returns:
- The complete formatted Special Unit Ability string such as "LRM1/1/-" or "CK15D2".
-
toString
-
addTargetingCrit
public void addTargetingCrit() -
addDamageCrit
public void addDamageCrit() -
addMovementCrit
Deprecated, for removal: This API element is subject to removal in a future version. -
getDamageCrits
public int getDamageCrits() -
getTargetingCrits
public int getTargetingCrits() -
getMpCrits
public int getMpCrits() -
getBaseGunnery
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- The base roll value for firing on targets. Equals the skill, modified by targeting crits.
-
setCurrentArmor
public void setCurrentArmor(int currentArmor) -
hasArmorDamage
public boolean hasArmorDamage()
-