Class MekLocation

java.lang.Object
mekhq.campaign.parts.Part
mekhq.campaign.parts.MekLocation
All Implemented Interfaces:
megamek.common.ITechnology, IPartWork, IWork

public class MekLocation extends Part
  • Field Details

    • loc

      protected int loc
    • structureType

      protected int structureType
    • clan

      protected boolean clan
    • tsm

      protected boolean tsm
    • sensors

      protected boolean sensors
    • lifeSupport

      protected boolean lifeSupport
  • Constructor Details

    • MekLocation

      public MekLocation()
    • MekLocation

      public MekLocation(int loc, int tonnage, int structureType, boolean clan, boolean hasTSM, boolean quad, boolean sensors, boolean lifeSupport, Campaign c)
  • Method Details

    • clone

      public MekLocation clone()
      Specified by:
      clone in class Part
    • getLoc

      public int getLoc()
    • isTsm

      public boolean isTsm()
    • getStructureType

      public int getStructureType()
    • setClan

      public void setClan(boolean clan)
    • getTonnage

      public double getTonnage()
      Specified by:
      getTonnage in class Part
    • getStickerPrice

      public Money getStickerPrice()
      Description copied from interface: IPartWork
      Sticker price is the value of the part according to the rulebooks
      Returns:
      the part's sticker price
    • forQuad

      public boolean forQuad()
    • isSamePartType

      public boolean isSamePartType(Part part)
      Specified by:
      isSamePartType in class Part
    • isSameStatus

      public boolean isSameStatus(Part part)
      Overrides:
      isSameStatus in class Part
    • getPercent

      public double getPercent()
    • setPercent

      protected void setPercent(double percent)
      Sets the percent armor remaining.
      Parameters:
      percent - The percent armor remaining, expressed as a fraction.
    • writeToXML

      public void writeToXML(PrintWriter pw, int indent)
      Specified by:
      writeToXML in class Part
    • loadFieldsFromXmlNode

      protected void loadFieldsFromXmlNode(Node wn)
      Specified by:
      loadFieldsFromXmlNode in class Part
    • fix

      public void fix()
      Specified by:
      fix in interface IPartWork
      Overrides:
      fix in class Part
    • getMissingPart

      public MissingMekLocation getMissingPart()
    • remove

      public void remove(boolean salvage)
    • updateConditionFromEntity

      public void updateConditionFromEntity(boolean checkForDestruction)
    • getBaseTime

      public int getBaseTime()
    • getDifficulty

      public int getDifficulty()
      Returns:
      the base difficulty of this work unit
    • isBreached

      public boolean isBreached()
      Gets a value indicating whether or not this location is breached.
    • setBreached

      protected void setBreached(boolean breached)
      Sets a value indicating whether or not the location is breached.
      Parameters:
      breached - A value indicating whether or not the location is breached.
    • isBlownOff

      public boolean isBlownOff()
      Gets a value indicating whether or not this location is blown off.
    • setBlownOff

      protected void setBlownOff(boolean blownOff)
      Sets a value indicating whether or not the location is blown off.
      Parameters:
      blownOff - A value indicating whether or not the location is blown off.
    • needsFixing

      public boolean needsFixing()
    • getDetails

      public String getDetails()
      Description copied from class: Part
      Gets a string containing details regarding the part, e.g. OmniPod or how many hits it has taken and its repair cost.
      Specified by:
      getDetails in interface IPartWork
      Overrides:
      getDetails in class Part
      Returns:
      A string containing details regarding the part.
    • getDetails

      public String getDetails(boolean includeRepairDetails)
      Description copied from class: Part
      Gets a string containing details regarding the part, and optionally include information on its repair status.
      Specified by:
      getDetails in interface IPartWork
      Overrides:
      getDetails in class Part
      Parameters:
      includeRepairDetails - true if the details should include information such as the number of hits or how much it would cost to repair the part.
      Returns:
      A string containing details regarding the part.
    • updateConditionFromPart

      public void updateConditionFromPart()
    • checkFixable

      @Nullable public String checkFixable()
    • checkSalvageable

      @Nullable public String checkSalvageable()
      Gets a string indicating why the location is not salvageable, or null if the location can be salvaged.
    • isSalvaging

      public boolean isSalvaging()
      Specified by:
      isSalvaging in interface IPartWork
      Overrides:
      isSalvaging in class Part
    • checkScrappable

      public String checkScrappable()
      Overrides:
      checkScrappable in class Part
    • getAllMods

      public megamek.common.TargetRoll getAllMods(Person tech)
      Specified by:
      getAllMods in interface IWork
      Overrides:
      getAllMods in class Part
    • getDesc

      public String getDesc()
      Specified by:
      getDesc in interface IPartWork
      Overrides:
      getDesc in class Part
    • onBadHipOrShoulder

      public boolean onBadHipOrShoulder()
      Overrides:
      onBadHipOrShoulder in class Part
    • isRightTechType

      public boolean isRightTechType(String skillType)
      Specified by:
      isRightTechType in interface IPartWork
      Overrides:
      isRightTechType in class Part
    • hasSensors

      public boolean hasSensors()
    • setSensors

      public void setSensors(boolean b)
    • hasLifeSupport

      public boolean hasLifeSupport()
    • setLifeSupport

      public void setLifeSupport(boolean b)
    • doMaintenanceDamage

      public void doMaintenanceDamage(int d)
      Overrides:
      doMaintenanceDamage in class Part
    • getLocationName

      public String getLocationName()
      Specified by:
      getLocationName in class Part
    • getLocation

      public int getLocation()
    • getTechAdvancement

      public megamek.common.TechAdvancement getTechAdvancement()
      Specified by:
      getTechAdvancement in class Part
    • getMRMSOptionType

      public PartRepairType getMRMSOptionType()
      Specified by:
      getMRMSOptionType in interface IPartWork
      Overrides:
      getMRMSOptionType in class Part
    • getRepairPartType

      public PartRepairType getRepairPartType()
      Specified by:
      getRepairPartType in interface IPartWork
      Overrides:
      getRepairPartType in class Part