Class MekSummary

java.lang.Object
megamek.common.loaders.MekSummary
All Implemented Interfaces:
Serializable, ASCardDisplayable, CombatRole, BattleForceSUAFormatter, BTObject

public class MekSummary extends Object implements Serializable, ASCardDisplayable
The MekSummary of a unit offers compiled information about the unit without having to load the file.
See Also:
  • Constructor Details

    • MekSummary

      public MekSummary()
  • Method Details

    • getName

      public String getName()
    • getChassis

      public String getChassis()
      Specified by:
      getChassis in interface ASCardDisplayable
      Returns:
      The AS element's chassis, such as "Atlas".
    • getFullChassis

      public String getFullChassis()
      Specified by:
      getFullChassis in interface ASCardDisplayable
    • setClanChassisName

      public void setClanChassisName(String name)
    • getClanChassisName

      public String getClanChassisName()
    • getModel

      public String getModel()
      Specified by:
      getModel in interface ASCardDisplayable
      Returns:
      The AS element's model, such as "AS7-D".
    • getMulId

      public int getMulId()
      Specified by:
      getMulId in interface ASCardDisplayable
      Returns:
      This AS element's MUL ID if it has one, -1 otherwise.
    • getUnitType

      public String getUnitType()
    • isCanon

      public boolean isCanon()
    • isPatchwork

      public boolean isPatchwork()
    • isFrankenMek

      public boolean isFrankenMek()
    • isDoomedOnGround

      public boolean isDoomedOnGround()
    • isDoomedInAtmosphere

      public boolean isDoomedInAtmosphere()
    • isDoomedInSpace

      public boolean isDoomedInSpace()
    • isDoomedInExtremeTemp

      public boolean isDoomedInExtremeTemp()
    • isDoomedInVacuum

      public boolean isDoomedInVacuum()
    • isClan

      public boolean isClan()
    • isSupport

      public boolean isSupport()
    • isBattlefieldSupportAsset

      public boolean isBattlefieldSupportAsset()
      Specified by:
      isBattlefieldSupportAsset in interface BTObject
      Returns:
      true if this summary represents a Battlefield Support Asset (a .bfs unit).
    • getUnitFileUUID

      @Nullable public String getUnitFileUUID()
      Returns:
      this unit's own unit-file UUID, or null if the file carries none
    • setUnitFileUUID

      public void setUnitFileUUID(@Nullable String unitFileUUID)
    • getLinkedUnitId

      @Nullable public String getLinkedUnitId()
      Returns:
      for a Battlefield Support Asset, the base unit's UUID it links to; null when standalone/non-asset
    • setLinkedUnitId

      public void setLinkedUnitId(@Nullable String linkedUnitId)
    • getUnitSubType

      public String getUnitSubType()
    • getSourceFile

      public File getSourceFile()
    • getInvalid

      public boolean getInvalid()
    • getTechLevel

      public String getTechLevel()
    • getTechLevelCode

      public int getTechLevelCode()
    • getTechBase

      public String getTechBase()
    • getFailedToLoadEquipment

      public boolean getFailedToLoadEquipment()
    • getSource

      public String getSource()
    • getPublished

      public String getPublished()
    • hasPublishedRecordSheet

      public boolean hasPublishedRecordSheet()
    • isNonCanonBySource

      public boolean isNonCanonBySource()
    • getEntryName

      public String getEntryName()
    • getYear

      public int getYear()
    • getType

      public int getType()
    • getType

      public int getType(int year)
    • getFullAccurateUnitType

      public String getFullAccurateUnitType()
    • getEntityType

      public long getEntityType()
    • getOmni

      public boolean getOmni()
    • getMilitary

      public boolean getMilitary()
    • getMountedInfantry

      public boolean getMountedInfantry()
    • getTankTurrets

      public int getTankTurrets()
    • getLowerArms

      public int getLowerArms()
    • getHands

      public int getHands()
    • getTroopCarryingSpace

      public double getTroopCarryingSpace()
    • getASFBays

      public int getASFBays()
    • getASFDoors

      public int getASFDoors()
    • getASFUnits

      public double getASFUnits()
    • getSmallCraftBays

      public int getSmallCraftBays()
    • getSmallCraftDoors

      public int getSmallCraftDoors()
    • getSmallCraftUnits

      public double getSmallCraftUnits()
    • getDockingCollars

      public int getDockingCollars()
    • getMekBays

      public int getMekBays()
    • getMekDoors

      public int getMekDoors()
    • getMekUnits

      public double getMekUnits()
    • getHeavyVehicleBays

      public int getHeavyVehicleBays()
    • getHeavyVehicleDoors

      public int getHeavyVehicleDoors()
    • getHeavyVehicleUnits

      public double getHeavyVehicleUnits()
    • getLightVehicleBays

      public int getLightVehicleBays()
    • getLightVehicleDoors

      public int getLightVehicleDoors()
    • getLightVehicleUnits

      public double getLightVehicleUnits()
    • getProtoMekBays

      public int getProtoMekBays()
    • getProtoMekDoors

      public int getProtoMekDoors()
    • getProtoMekUnits

      public double getProtoMekUnits()
    • getBattleArmorBays

      public int getBattleArmorBays()
    • getBattleArmorDoors

      public int getBattleArmorDoors()
    • getBattleArmorUnits

      public double getBattleArmorUnits()
    • getInfantryBays

      public int getInfantryBays()
    • getInfantryDoors

      public int getInfantryDoors()
    • getInfantryUnits

      public double getInfantryUnits()
    • getSuperHeavyVehicleBays

      public int getSuperHeavyVehicleBays()
    • getSuperHeavyVehicleDoors

      public int getSuperHeavyVehicleDoors()
    • getSuperHeavyVehicleUnits

      public double getSuperHeavyVehicleUnits()
    • getDropShuttleBays

      public int getDropShuttleBays()
    • getDropShuttleDoors

      public int getDropShuttleDoors()
    • getDropShuttleUnits

      public double getDropShuttleUnits()
    • getBattleArmorHandles

      public int getBattleArmorHandles()
    • getCargoBayUnits

      public double getCargoBayUnits()
    • getNavalRepairFacilities

      public int getNavalRepairFacilities()
    • getTons

      public double getTons()
    • getTOWeight

      public double getTOWeight()
    • getTWWeight

      public double getTWWeight()
    • getBV

      public int getBV()
    • getBfsVeteranBv

      public int getBfsVeteranBv()
      Returns:
      for a Battlefield Support Asset, the Veteran cost in Battle Value (Veteran BSP times 20), or 0 if the asset has no Veteran variant (or is not an asset)
    • setBfsVeteranBv

      public void setBfsVeteranBv(int bfsVeteranBv)
    • getBfsAssetType

      @Nullable public BFSAssetType getBfsAssetType()
      Returns:
      the Asset's rules category, or null if this summary is not a Battlefield Support Asset
    • setBfsAssetType

      public void setBfsAssetType(@Nullable BFSAssetType bfsAssetType)
    • getBfsCardTitle

      @Nullable public String getBfsCardTitle()
      Returns:
      the Asset card title, or null for a non-asset
    • setBfsCardTitle

      public void setBfsCardTitle(@Nullable String bfsCardTitle)
    • getBfsCardSubtitle

      @Nullable public String getBfsCardSubtitle()
      Returns:
      the Asset card subtitle, or null for a non-asset
    • setBfsCardSubtitle

      public void setBfsCardSubtitle(@Nullable String bfsCardSubtitle)
    • getBfsMovementMode

      @Nullable public EntityMovementMode getBfsMovementMode()
      Returns:
      the Asset's movement mode, or null for a non-asset
    • setBfsMovementMode

      public void setBfsMovementMode(@Nullable EntityMovementMode bfsMovementMode)
    • getBfsMp

      public int getBfsMp()
      Returns:
      the Asset's single Movement Point allowance
    • setBfsMp

      public void setBfsMp(int bfsMp)
    • getBfsTmm

      public int getBfsTmm()
      Returns:
      the Asset's fixed Target Movement Modifier
    • setBfsTmm

      public void setBfsTmm(int bfsTmm)
    • getBfsRange

      @Nullable public BFSRange getBfsRange()
      Returns:
      the Asset's Short/Medium/Long range, or null for a non-asset
    • setBfsRange

      public void setBfsRange(@Nullable BFSRange bfsRange)
    • getBfsRangeKeyword

      @Nullable public String getBfsRangeKeyword()
      Returns:
      the Asset's keyword-range label, or null for a numeric/absent range
    • setBfsRangeKeyword

      public void setBfsRangeKeyword(@Nullable String bfsRangeKeyword)
    • getBfsSkill

      public int getBfsSkill()
      Returns:
      the Asset's crew Skill
    • setBfsSkill

      public void setBfsSkill(int bfsSkill)
    • getBfsDamage

      @Nullable public BFSDamage getBfsDamage()
      Returns:
      the Asset's attack damage, or null for a non-asset
    • setBfsDamage

      public void setBfsDamage(@Nullable BFSDamage bfsDamage)
    • getBfsDestroyCheck

      public int getBfsDestroyCheck()
      Returns:
      the Asset's undamaged Destroy Check target number
    • setBfsDestroyCheck

      public void setBfsDestroyCheck(int bfsDestroyCheck)
    • getBfsThreshold

      public int getBfsThreshold()
      Returns:
      the Asset's damage Threshold
    • setBfsThreshold

      public void setBfsThreshold(int bfsThreshold)
    • getBfsBsp

      public int getBfsBsp()
      Returns:
      the Asset's effective Battlefield Support Point cost
    • setBfsBsp

      public void setBfsBsp(int bfsBsp)
    • getBfsSpecials

      public List<BFSSpecialType> getBfsSpecials()
      Returns:
      the recognized Specials present on the Asset (never null)
    • setBfsSpecials

      public void setBfsSpecials(List<BFSSpecialType> bfsSpecials)
    • getBfsSpecialDetails

      public List<BFSSpecial> getBfsSpecialDetails()
      Returns:
      the full Specials present on the Asset, retaining parameter values (never null)
    • setBfsSpecialDetails

      public void setBfsSpecialDetails(List<BFSSpecial> bfsSpecialDetails)
    • getGenericBattleValue

      public int getGenericBattleValue()
    • getCost

      public long getCost()
    • getDryCost

      public long getDryCost()
    • getAlternateCost

      public long getAlternateCost()
    • getModified

      public long getModified()
    • getLevel

      public String getLevel()
    • getAdvancedTechYear

      @Deprecated(since="0.51.0", forRemoval=true) public int getAdvancedTechYear()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getStandardTechYear

      @Deprecated(since="0.51.0", forRemoval=true) public int getStandardTechYear()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getLevel

      public String getLevel(int year)
    • getPointValue

      public int getPointValue()
      Specified by:
      getPointValue in interface ASCardDisplayable
      Returns:
      The AS element's Point Value (PV). This is not adjusted for damage on the element.
    • getASUnitType

      public ASUnitType getASUnitType()
      Specified by:
      getASUnitType in interface ASCardDisplayable
      Returns:
      The AS element's type (TP), e.g. BM or CV.
    • getSize

      public int getSize()
      Specified by:
      getSize in interface ASCardDisplayable
      Returns:
      The AS element's size (SZ).
    • getTMM

      public int getTMM()
      Specified by:
      getTMM in interface ASCardDisplayable
      Returns:
      The AS element's Target Movement Modifier (TMM).
    • getMovement

      public Map<String,Integer> getMovement()
      Specified by:
      getMovement in interface ASCardDisplayable
      Returns:
      The AS element's entire movement capability (MV).
    • getPrimaryMovementMode

      public String getPrimaryMovementMode()
      Specified by:
      getPrimaryMovementMode in interface ASCardDisplayable
      Returns:
      The primary (= first) movement type String, such as "" for some ground units or "s" for submarines.
    • getStandardDamage

      public ASDamageVector getStandardDamage()
      Specified by:
      getStandardDamage in interface ASCardDisplayable
      Returns:
      The standard damage (SML or SMLE depending on type). This will be empty for elements that use arcs.
    • getOV

      public int getOV()
      Specified by:
      getOV in interface ASCardDisplayable
      Returns:
      The AS element's extra Overheat Damage capability (OV) (not the current heat buildup).
    • getFrontArc

      public ASArcSummary getFrontArc()
      Specified by:
      getFrontArc in interface ASCardDisplayable
      Returns:
      The AS element's front arc. Returns an empty arc for elements that don't use arcs.
    • getLeftArc

      public ASArcSummary getLeftArc()
      Specified by:
      getLeftArc in interface ASCardDisplayable
      Returns:
      The AS element's left arc. Returns an empty arc for elements that don't use arcs.
    • getRightArc

      public ASArcSummary getRightArc()
      Specified by:
      getRightArc in interface ASCardDisplayable
      Returns:
      The AS element's right arc. Returns an empty arc for elements that don't use arcs.
    • getRearArc

      public ASArcSummary getRearArc()
      Specified by:
      getRearArc in interface ASCardDisplayable
      Returns:
      The AS element's rear arc. Returns an empty arc for elements that don't use arcs.
    • getThreshold

      public int getThreshold()
      Specified by:
      getThreshold in interface ASCardDisplayable
      Returns:
      The AS element's armor threshold (TH), if it uses threshold.
    • getFullArmor

      public int getFullArmor()
      Specified by:
      getFullArmor in interface ASCardDisplayable
      Returns:
      The AS element's full (=undamaged) Armor (A).
    • getFullStructure

      public int getFullStructure()
      Specified by:
      getFullStructure in interface ASCardDisplayable
      Returns:
      The AS element's full (=undamaged) Structure (S).
    • getSquadSize

      public int getSquadSize()
      Specified by:
      getSquadSize in interface ASCardDisplayable
      Returns:
      The squad size (typically 4, 5 or 6), if this AS element is a BA.
    • getSpecialAbilities

      public ASSpecialAbilityCollection getSpecialAbilities()
      Specified by:
      getSpecialAbilities in interface ASCardDisplayable
      Returns:
      The element's central special abilities (not those in arcs).
    • getRole

      public UnitRole getRole()
      Specified by:
      getRole in interface CombatRole
      Returns:
      The battlefield role (UnitRole) of this combat unit.
    • getForceGeneratorAvailability

      public List<ForceGeneratorAvailability> getForceGeneratorAvailability()
      Returns the Force Generator availability declared in this unit's file. Empty for canon units, whose availability comes from the era files in data/forcegenerator instead.
      Returns:
      the availability entries, never null
    • setForceGeneratorAvailability

      public void setForceGeneratorAvailability(List<ForceGeneratorAvailability> forceGeneratorAvailability)
    • getMissionRoles

      public String getMissionRoles()
      Returns the Force Generator mission roles declared in this unit's file, as raw comma-separated text such as "fire_support,urban".
      Returns:
      the mission role text, never null
    • setMissionRoles

      public void setMissionRoles(String missionRoles)
    • setFullAccurateUnitType

      public void setFullAccurateUnitType(String type)
    • setEntityType

      public void setEntityType(long type)
    • setOmni

      public void setOmni(boolean b)
    • setMilitary

      public void setMilitary(boolean b)
    • setMountedInfantry

      public void setMountedInfantry(boolean b)
    • setTankTurrets

      public void setTankTurrets(int i)
    • setLowerArms

      public void setLowerArms(int i)
    • setHands

      public void setHands(int i)
    • setTroopCarryingSpace

      public void setTroopCarryingSpace(double d)
    • setASFBays

      public void setASFBays(int i)
    • setASFDoors

      public void setASFDoors(int i)
    • setASFUnits

      public void setASFUnits(double d)
    • setSmallCraftBays

      public void setSmallCraftBays(int i)
    • setSmallCraftDoors

      public void setSmallCraftDoors(int i)
    • setSmallCraftUnits

      public void setSmallCraftUnits(double d)
    • setDockingCollars

      public void setDockingCollars(int i)
    • setMekBays

      public void setMekBays(int i)
    • setMekDoors

      public void setMekDoors(int i)
    • setMekUnits

      public void setMekUnits(double d)
    • setHeavyVehicleBays

      public void setHeavyVehicleBays(int i)
    • setHeavyVehicleDoors

      public void setHeavyVehicleDoors(int i)
    • setHeavyVehicleUnits

      public void setHeavyVehicleUnits(double d)
    • setLightVehicleBays

      public void setLightVehicleBays(int i)
    • setLightVehicleDoors

      public void setLightVehicleDoors(int i)
    • setLightVehicleUnits

      public void setLightVehicleUnits(double d)
    • setProtoMekBays

      public void setProtoMekBays(int i)
    • setProtoMekDoors

      public void setProtoMekDoors(int i)
    • setProtoMekUnits

      public void setProtoMekUnits(double d)
    • setBattleArmorBays

      public void setBattleArmorBays(int i)
    • setBattleArmorDoors

      public void setBattleArmorDoors(int i)
    • setBattleArmorUnits

      public void setBattleArmorUnits(double d)
    • setInfantryBays

      public void setInfantryBays(int i)
    • setInfantryDoors

      public void setInfantryDoors(int i)
    • setInfantryUnits

      public void setInfantryUnits(double d)
    • setSuperHeavyVehicleBays

      public void setSuperHeavyVehicleBays(int i)
    • setSuperHeavyVehicleDoors

      public void setSuperHeavyVehicleDoors(int i)
    • setSuperHeavyVehicleUnits

      public void setSuperHeavyVehicleUnits(double d)
    • setDropShuttleBays

      public void setDropShuttleBays(int i)
    • setDropShuttleDoors

      public void setDropShuttleDoors(int i)
    • setDropShuttleUnits

      public void setDropShuttleUnits(double d)
    • setBattleArmorHandles

      public void setBattleArmorHandles(int i)
    • setCargoBayUnits

      public void setCargoBayUnits(double d)
    • setNavalRepairFacilities

      public void setNavalRepairFacilities(int i)
    • setName

      public void setName(String sName)
    • setChassis

      public void setChassis(String sChassis)
    • setModel

      public void setModel(String sModel)
    • setMulId

      public void setMulId(int mulId)
    • setUnitType

      public void setUnitType(String sUnitType)
    • setSourceFile

      public void setSourceFile(File sSourceFile)
    • setInvalid

      public void setInvalid(boolean b)
    • setTechLevel

      public void setTechLevel(String s)
    • setTechLevelCode

      public void setTechLevelCode(int i)
    • setTechBase

      public void setTechBase(String s)
    • setFailedToLoadEquipment

      public void setFailedToLoadEquipment(boolean b)
    • setSource

      public void setSource(String sSource)
    • setPublished

      public void setPublished(String published)
    • setNonCanonBySource

      public void setNonCanonBySource(boolean nonCanonBySource)
    • setEntryName

      public void setEntryName(String sEntryName)
    • setYear

      public void setYear(int nYear)
    • setType

      public void setType(int nType)
    • setAltTypes

      public void setAltTypes(int[] altTypes)
    • setTons

      public void setTons(double nTons)
    • setTOWeight

      public void setTOWeight(double TOSuitTons)
    • setTWWeight

      public void setTWWeight(double TWSuitTons)
    • setCost

      public void setCost(long nCost)
    • setDryCost

      public void setDryCost(long nCost)
    • setAlternateCost

      public void setAlternateCost(long aCost)
    • setBV

      public void setBV(int nBV)
    • setGenericBattleValue

      public void setGenericBattleValue(int genericBattleValue)
    • setModified

      public void setModified(long lModified)
    • setLevel

      public void setLevel(String level)
    • setAdvancedYear

      public void setAdvancedYear(int year)
    • setStandardYear

      public void setStandardYear(int year)
    • setCanon

      public void setCanon(boolean canon)
    • setPatchwork

      public void setPatchwork(boolean patchwork)
    • setFrankenMek

      public void setFrankenMek(boolean frankenMek)
    • setDoomedOnGround

      public void setDoomedOnGround(boolean doomedOnGround)
    • setDoomedInAtmosphere

      public void setDoomedInAtmosphere(boolean doomedInAtmosphere)
    • setDoomedInSpace

      public void setDoomedInSpace(boolean doomedInSpace)
    • setDoomedInExtremeTemp

      public void setDoomedInExtremeTemp(boolean doomedInExtremeTemp)
    • setDoomedInVacuum

      public void setDoomedInVacuum(boolean doomedInVacuum)
    • setClan

      public void setClan(boolean clan)
    • setSupport

      public void setSupport(boolean support)
    • setUnitSubType

      public void setUnitSubType(String subType)
    • setWeightClass

      public void setWeightClass(int weightClass)
    • getWeightClass

      public int getWeightClass()
    • getWalkMp

      public int getWalkMp()
    • setWalkMp

      public void setWalkMp(int walkMp)
    • getRunMp

      public int getRunMp()
    • setRunMp

      public void setRunMp(int runMp)
    • getJumpMp

      public int getJumpMp()
    • setJumpMp

      public void setJumpMp(int jumpMp)
    • setFluffImage

      public void setFluffImage(String base64image)
    • getFluffImage

      @Nullable public Image getFluffImage()
      Description copied from interface: BTObject
      Returns a fluff image for this unit or object to be shown e.g. in the unit summary.

      Important: This method returns only a fluff image that is stored in the object itself, e.g. if it was part of the unit's file or is created by the unit itself. It does not search for fluff images in the fluff images directories. For GUI, use FluffImageHelper.getFluffImage(BTObject) instead; that method will retrieve either a unit's own fluff image or an image from the fluff images directories (if there is one).

      The default implementation returns null. For canon units, this will return null, as they do not store fluff images in the unit files.

      Specified by:
      getFluffImage in interface BTObject
      Returns:
      A fluff image for this object/unit if it contains one as part of the object/unit
    • setEquipment

      public void setEquipment(List<Mounted<?>> mountedList)
      Given the list of equipment mounted on this unit, parse it into a unique list of names and the number of times that name appears.
      Parameters:
      mountedList - A collection of Mounted equipment
    • getEquipmentNames

      public Vector<String> getEquipmentNames()
    • getEquipmentQuantities

      public Vector<Integer> getEquipmentQuantities()
    • setQuirkNames

      public void setQuirkNames(Quirks quirks)
    • getQuirkNames

      public String getQuirkNames()
    • setWeaponQuirkNames

      public void setWeaponQuirkNames(Entity entity)
    • getWeaponQuirkNames

      public String getWeaponQuirkNames()
    • setTotalArmor

      public void setTotalArmor(int totalArmor)
    • getMoveMode

      public EntityMovementMode getMoveMode()
    • setMoveMode

      public void setMoveMode(EntityMovementMode moveMode)
    • getTotalArmor

      public int getTotalArmor()
    • setTotalInternal

      public void setTotalInternal(int totalInternal)
    • getTotalInternal

      public int getTotalInternal()
    • setInternalsType

      public void setInternalsType(int internalsType)
    • getInternalsType

      public int getInternalsType()
    • setArmorType

      public void setArmorType(int[] locsArmor)
      Takes the armor type at all locations and creates a set of the armor types.
      Parameters:
      locsArmor - An array that stores the armor type at each location.
    • getArmorType

      public HashSet<Integer> getArmorType()
    • getArmorTypes

      public int[] getArmorTypes()
    • setArmorTypes

      public void setArmorTypes(int[] al)
    • getArmorTechTypes

      public int[] getArmorTechTypes()
    • setArmorTechTypes

      public void setArmorTechTypes(int[] att)
    • setCockpitType

      public void setCockpitType(int cockpitType)
    • getCockpitType

      public int getCockpitType()
    • getEngineName

      public String getEngineName()
    • setEngineName

      public void setEngineName(String engineName)
    • getEngineType

      public int getEngineType()
    • setEngineType

      public void setEngineType(int engineType)
    • getGyroType

      public int getGyroType()
    • setGyroType

      public void setGyroType(int gyroType)
    • getMyomerName

      public String getMyomerName()
    • setMyomerName

      public void setMyomerName(String myomerName)
    • getSuitWeight

      public double getSuitWeight()
    • setSuitWeight

      public void setSuitWeight(double suitWeight)
    • getExtinctRange

      public String getExtinctRange()
    • setAsUnitType

      public void setAsUnitType(ASUnitType asUnitType)
    • setSize

      public void setSize(int size)
    • setTmm

      public void setTmm(int tmm)
    • setMovement

      public void setMovement(Map<String,Integer> movement)
    • setPrimaryMovementMode

      public void setPrimaryMovementMode(String primaryMovementMode)
    • setStandardDamage

      public void setStandardDamage(ASDamageVector standardDamage)
    • setOverheat

      public void setOverheat(int overheat)
    • setFrontArc

      public void setFrontArc(ASArcSummary frontArc)
    • setLeftArc

      public void setLeftArc(ASArcSummary leftArc)
    • setRightArc

      public void setRightArc(ASArcSummary rightArc)
    • setRearArc

      public void setRearArc(ASArcSummary rearArc)
    • setThreshold

      public void setThreshold(int threshold)
    • setFullArmor

      public void setFullArmor(int fullArmor)
    • setFullStructure

      public void setFullStructure(int fullStructure)
    • setSquadSize

      public void setSquadSize(int squadSize)
    • setPointValue

      public void setPointValue(int pointValue)
    • setSpecialAbilities

      public void setSpecialAbilities(ASSpecialAbilityCollection specialAbilities)
    • setUnitRole

      public void setUnitRole(UnitRole role)
    • setExtinctRange

      public void setExtinctRange(String extinctRange)
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • showSUA

      public boolean showSUA(BattleForceSUA sua)
      Description copied from interface: BattleForceSUAFormatter
      Returns 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:
      showSUA in interface BattleForceSUAFormatter
      Returns:
      True when this object wants to have the given sua displayed among its special abilities.
    • formatSUA

      public String formatSUA(BattleForceSUA sua, String delimiter, ASSpecialAbilityCollector collection)
      Description copied from interface: BattleForceSUAFormatter
      Returns 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:
      formatSUA in interface BattleForceSUAFormatter
      Parameters:
      sua - The Special Unit Ability to process
      delimiter - 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".
    • loadEntity

      @Nullable public Entity loadEntity()
      Loads and returns the entity for this MekSummary. If the entity cannot be loaded, the error is logged and null is returned.
      Returns:
      The loaded entity or null in case of an error
    • loadEntity

      @Nullable public static Entity loadEntity(String fullName)
      Loads and returns the entity for the given full name. If the entity cannot be loaded, the error is logged and null is returned. This is a shortcut for first loading the MekSummary using MekSummaryCache.getMek(String) and then loadEntity().
      Returns:
      The loaded entity or null in case of an error
    • loadEntity

      @Nullable public static Entity loadEntity(File unitFile)
      Loads an Entity directly from the specified unit file.

      Attempts to parse the file using MekFileParser and retrieve an entity object. If the file does not contain a valid entity, or an error occurs while reading or parsing, this method logs the error and returns null.

      Usage: This method is intended for use in tests, so we can easily load in units without needing to substantiate the entire unit cache.

      Parameters:
      unitFile - the file containing the unit data to load
      Returns:
      the loaded Entity, or null if loading failed
      Since:
      0.50.07
    • toString

      public String toString()
      Overrides:
      toString in class Object