Package mekhq.campaign.parts
Class MekLocation
java.lang.Object
mekhq.campaign.parts.Part
mekhq.campaign.parts.MekLocation
-
Nested Class Summary
Nested classes/interfaces inherited from class mekhq.campaign.parts.Part
Part.PartPersonRef, Part.PartRef, Part.PartUnitRef
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected boolean
protected int
protected boolean
protected int
protected boolean
Fields inherited from class mekhq.campaign.parts.Part
brandNew, campaign, childParts, daysToArrival, daysToWait, hits, id, mode, name, omniPodded, parentPart, quality, quantity, resources, shorthandedMod, skillMin, T_BOTH, T_CLAN, T_IS, T_UNKNOWN, TA_GENERIC, TA_POD, tech, timeSpent, unit, unitTonnage, unitTonnageMatters, usedForRefitPlanning, workingOvertime
Fields inherited from interface megamek.common.ITechnology
DATE_ES, DATE_NONE, DATE_PS, ERA_CLAN, ERA_DA, ERA_NUM, ERA_SL, ERA_SW, F_CBR, F_CBS, F_CC, F_CCC, F_CCY, F_CF, F_CFM, F_CGB, F_CGS, F_CHH, F_CIH, F_CJF, F_CLAN, F_CMN, F_CNC, F_CP, F_CS, F_CSA, F_CSF, F_CSJ, F_CSR, F_CSV, F_CWF, F_CWM, F_CWV, F_CWX, F_DC, F_EI, F_FC, F_FR, F_FS, F_FW, F_IS, F_LC, F_MC, F_MERC, F_MH, F_NONE, F_OA, F_PER, F_RA, F_RD, F_RS, F_RW, F_TA, F_TC, F_TH, F_WB, IO_FACTION_CODES, MM_FACTION_CODES, RATING_A, RATING_B, RATING_C, RATING_D, RATING_E, RATING_F, RATING_FSTAR, RATING_X, ratingNames, TECH_BASE_ALL, TECH_BASE_CLAN, TECH_BASE_IS
-
Constructor Summary
ConstructorsConstructorDescriptionMekLocation
(int loc, int tonnage, int structureType, boolean clan, boolean hasTSM, boolean quad, boolean sensors, boolean lifeSupport, Campaign c) -
Method Summary
Modifier and TypeMethodDescriptionGets a string indicating why the location is not salvageable, ornull
if the location can be salvaged.clone()
void
doMaintenanceDamage
(int d) void
fix()
boolean
forQuad()
megamek.common.TargetRoll
getAllMods
(Person tech) int
getDesc()
Gets a string containing details regarding the part, e.g.getDetails
(boolean includeRepairDetails) Gets a string containing details regarding the part, and optionally include information on its repair status.int
int
getLoc()
int
double
Sticker price is the value of the part according to the rulebooksint
megamek.common.TechAdvancement
double
boolean
boolean
boolean
Gets a value indicating whether or not this location is blown off.boolean
Gets a value indicating whether or not this location is breached.boolean
isRightTechType
(String skillType) boolean
boolean
isSamePartType
(Part part) boolean
isSameStatus
(Part part) boolean
isTsm()
protected void
boolean
boolean
void
remove
(boolean salvage) protected void
setBlownOff
(boolean blownOff) Sets a value indicating whether or not the location is blown off.protected void
setBreached
(boolean breached) Sets a value indicating whether or not the location is breached.void
setClan
(boolean clan) void
setLifeSupport
(boolean b) protected void
setPercent
(double percent) Sets the percent armor remaining.void
setSensors
(boolean b) void
updateConditionFromEntity
(boolean checkForDestruction) void
void
writeToXML
(PrintWriter pw, int indent) Methods inherited from class mekhq.campaign.parts.Part
addChildPart, addTimeSpent, adjustCostsForCampaignOptions, adjustCostsForCampaignOptions, calcYearAvailability, cancelAssignment, cancelReservation, canChangeWorkMode, canNeverScrap, changeQuantity, copyBaseData, decrementDaysToWait, decrementQuantity, fail, findPartImage, fixReferences, generateInstanceFromXML, getAcquisitionWork, getActualTime, getActualValue, getAllModsForMaintenance, getArrivalReport, getAvailability, getBaseAvailability, getCampaign, getChildParts, getCommonDate, getCommonDate, getCurrentModeName, getDaysToArrival, getDaysToWait, getExtinctionDate, getExtinctionDate, getExtinctionDate, getHits, getId, getIntroductionDate, getIntroductionDate, getIntroductionDate, getMode, getName, getParentPart, getPartName, getProductionDate, getProductionDate, getProductionDate, getPrototypeDate, getPrototypeDate, getPrototypeDate, getQuality, getQualityName, getQuantity, getQuantityName, getRefitUnit, getReintroductionDate, getReintroductionDate, getReintroductionDate, getRepairDesc, getReplacementPart, getSellableQuantity, getShoppingListReport, getShorthandedMod, getSimpleTechLevel, getSimpleTechLevel, getSimpleTechLevel, getSkillMin, getStaticTechLevel, getStatus, getTech, getTechBase, getTechBaseName, getTechBaseName, getTechLevel, getTechRating, getTimeLeft, getTimeSpent, getUndamagedValue, getUnit, getUnitTonnage, hasChildParts, hasParentPart, hasReplacementPart, hasWorkedOvertime, improveQuality, incrementQuantity, isBeingWorkedOn, isBrandNew, isClan, isClanTechBase, isInLocation, isInSupply, isIntroducedBy, isMixedTech, isMountedOnDestroyedLocation, isOmniPoddable, isOmniPodded, isPartForEquipmentNum, isPresent, isPriceAdjustedForAmount, isReservedForRefit, isReservedForReplacement, isSamePartTypeAndStatus, isSpare, isTeamSalvaging, isUnitTonnageMatters, isUsedForRefitPlanning, needsMaintenance, postProcessCampaignAddition, reduceQuality, removeAllChildParts, removeChildPart, reservePart, resetDaysToWait, resetModeToNormal, resetOvertime, resetRepairSettings, resetTimeSpent, scrap, setBrandNew, setCampaign, setDaysToArrival, setHits, setId, setMode, setOmniPodded, setParentPart, setQuality, setQuantity, setRefitUnit, setReplacementPart, setReservedBy, setShorthandedMod, setSkillMin, setTech, setUnit, setUsedForRefitPlanning, setWorkedOvertime, succeed, toString, writeToXMLBegin, writeToXMLEnd
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface megamek.common.ITechnology
calcEraAvailability, calcEraAvailability, calcYearAvailability, calcYearAvailability, findMinimumRulesLevel, findMinimumRulesLevel, getAdvancedRange, getAdvancedRange, getEraAvailabilityName, getEraAvailabilityName, getExperimentalRange, getExperimentalRange, getExtinctionRange, getExtinctionRange, getFullRatingName, getFullRatingName, getSimpleLevel, getSimpleLevel, getSimpleLevel, getStandardRange, getStandardRange, getTechLevel, getTechLevel, getTechRatingName, isAvailableIn, isAvailableIn, isAvailableIn, isExtinct, isExtinct, isExtinct, isIntroLevel, isLegal, isLegal, isUnofficial
-
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
-
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 classPart
-
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
- Specified by:
isSamePartType
in classPart
-
isSameStatus
- Overrides:
isSameStatus
in classPart
-
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
- Specified by:
writeToXML
in classPart
-
loadFieldsFromXmlNode
- Specified by:
loadFieldsFromXmlNode
in classPart
-
fix
public void fix() -
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
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 interfaceIPartWork
- Overrides:
getDetails
in classPart
- Returns:
- A string containing details regarding the part.
-
getDetails
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 interfaceIPartWork
- Overrides:
getDetails
in classPart
- 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
-
checkSalvageable
Gets a string indicating why the location is not salvageable, ornull
if the location can be salvaged. -
isSalvaging
public boolean isSalvaging()- Specified by:
isSalvaging
in interfaceIPartWork
- Overrides:
isSalvaging
in classPart
-
checkScrappable
- Overrides:
checkScrappable
in classPart
-
getAllMods
- Specified by:
getAllMods
in interfaceIWork
- Overrides:
getAllMods
in classPart
-
getDesc
-
onBadHipOrShoulder
public boolean onBadHipOrShoulder()- Overrides:
onBadHipOrShoulder
in classPart
-
isRightTechType
- Specified by:
isRightTechType
in interfaceIPartWork
- Overrides:
isRightTechType
in classPart
-
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 classPart
-
getLocationName
- Specified by:
getLocationName
in classPart
-
getLocation
public int getLocation() -
getTechAdvancement
public megamek.common.TechAdvancement getTechAdvancement()- Specified by:
getTechAdvancement
in classPart
-
getMRMSOptionType
- Specified by:
getMRMSOptionType
in interfaceIPartWork
- Overrides:
getMRMSOptionType
in classPart
-
getRepairPartType
- Specified by:
getRepairPartType
in interfaceIPartWork
- Overrides:
getRepairPartType
in classPart
-