Class EquipmentType
- All Implemented Interfaces:
ITechnology
- Direct Known Subclasses:
AmmoType,MiscType,WeaponType
- Since:
- April 1, 2002, 1:35 PM
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static Vector<EquipmentType> doublestatic final intprotected doublestatic final intstatic final intprotected intsometimes some modes can be switched at the end of turn and some instantly In that case, the specific end of turn mode names can be added hereprotected booleanprotected EquipmentBitSetprotected booleanprotected booleancan modes be switched instantly, or at end of turn?protected Stringprotected static Hashtable<String, EquipmentType> protected final Vector<EquipmentMode> what modes can this equipment be in?protected Stringprotected booleanprotected StringKeeps track of page numbers for rules references.protected Stringprotected StringSorting lists of equipment by this string groups and sorts equipment better.protected booleancan the criticalSlots for this be spread over locations?static final String[]static final double[]static final String[]protected intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intprotected static final TechAdvancementprotected static final TechAdvancementprotected intprotected TechAdvancementprotected intprotected doublestatic final doublestatic final Stringstatic final StringFields inherited from interface megamek.common.interfaces.ITechnology
DATE_ES, DATE_NONE, DATE_PS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEndTurnMode(String mode) protected voidAdds equipment flags to the YAML data map.voidvoidaddLookupName(String s, boolean includeInNames) booleanAdd a mode to the Equipment TODO: Refactor so the equipment knows the phase they can be armed/disarmedprotected static voidaddType(EquipmentType type) static List<EquipmentType> allTypes()booleanprotected voidClears lookup identity inherited from a superclass constructor.protected voidClears the modes that this type of equipment can be in.booleanstatic EquipmentTypeReturns an EquipmentType having the given internal name or lookup name (but not the "name" which is the display text unless it's equal to the internal name).static EquipmentTypeReturns an equipment type by lookup name, preferring the requested tech base when an unqualified display name is shared by multiple equipment types.static Enumeration<EquipmentType> static ArmorTypegetArmorFromName(String key) Explicit armor lookup by namestatic intstatic StringgetArmorTypeName(int armorType) static StringgetArmorTypeName(int armorType, boolean clan) getBaseAvailability(Era era) doubledoubledoubledoubledoubleintdoubleFor variable-sized equipment this assumes a size of 1.0.doublegetDesc()getDesc(double size) static StringgetEquipDateAsString(int date) Deprecated, for removal: This API element is subject to removal in a future version.intintgetExtinctionDate(boolean clan) intgetExtinctionDate(boolean clan, Faction faction) getFlags()intgetHeat()This does not include heat generated by stealth armor, as that depends on whether it is installed as patchwork and does not appear in the equipment list of all unit types.intintgetIntroductionDate(boolean clan) intgetIntroductionDate(boolean clan, Faction faction) static Map<String, Set<EquipmentType>> getMode(int modeNum) Returns the mode numbermodeNumfrom the list of modes available for this type of equipment.getModes()intintgetModesCount(Mounted<?> mounted) getName()getName(double size) getNames()intgetNumCriticalSlots(Entity entity) intgetNumCriticalSlots(Entity entity, double size) intintgetProductionDate(boolean clan, Faction faction) intintgetPrototypeDate(boolean clan, Faction faction) doubleintintgetReintroductionDate(boolean clan) intgetReintroductionDate(boolean clan, Faction faction) getShortName(double size) Sorting with the String returned by this method results in an improved ordering and grouping of equipment than by getName(); for example, AC2/5/10/20 will appear in that order instead of the order AC10/2/20/5 and S/M/L Lasers will be grouped together.For non-era-based usage, provide a single tech level that does not vary with date.static doublegetStructureCost(int inStructure) static StructureTypeExplicit structure lookup by namestatic TechAdvancementgetStructureTechAdvancement(int at, boolean clan) static intstatic StringgetStructureTypeAbbrev(int structureType) static StringgetStructureTypeName(int structureType) static StringgetStructureTypeName(int structureType, boolean clan) intgetSupportVeeSlots(Entity entity) intgetTankSlots(Entity entity) intgetTechLevel(int date) intgetTechLevel(int date, boolean clan) intgetToHitModifier(Mounted<?> mounted) intgetToHitModifierAtRange(Mounted<?> mounted, int range) Returns the to-hit modifier for a range band.doublegetTonnage(Entity entity) Calculates the weight of the equipment.doublegetTonnage(Entity entity, double size) Calculates the weight of the equipment.doublegetTonnage(Entity entity, int location, double size) Calculates the weight of the equipment.doublegetTonnage(Entity entity, int location, double size, RoundWeight defaultMethod) Calculates the weight of the equipment, with the option to override the standard rounding based on unit type.Constructs a map containing the YAML-serializable data for this equipment type.protected StringReturns the YAML type name for this equipment type.booleanhasAnyFlag(EquipmentBitSet mask) booleanhasAnyFlag(EquipmentFlag... flags) booleanhasFlag(EquipmentBitSet flag) Checks if the equipment has all the specified flags.booleanhasFlag(EquipmentFlag flag) Returns true when this EquipmentType has the given flag.inthashCode()booleanReturnstrueif this equipment has a range-based to-hit modifier.booleanbooleanhasModes()booleanhasModeType(String modeType) Simple way to check if a piece of equipment has a specific usage/firing modestatic voidbooleanReturns true if this equipment is that identified by the given typeInternalName String.booleanReturns true if this equipment is any of those identified by the given type Strings.static booleanConvenience method to test whether an EquipmentType instance is armor.booleanbooleanisClan()booleanbooleanisExplosive(Mounted<?> mounted) booleanisExplosive(Mounted<?> mounted, boolean ignoreCharge) booleanbooleanbooleanbooleanisNextTurnModeSwitch(String mode) Some equipment types might have both instant and next turn mode switching.booleanbooleanstatic booleanConvenience method to test whether an EquipmentType instance is mek structure.booleanbooleanbooleanbooleanbooleanbooleanbooleanmatchesName(String name) Add a way to find if a given equipment type matches a particular string in _any_ of its names (Case sensitive)booleanbooleanremoveMode(String mode) Remove a specific mode from the list of modes.voidsetFlags(EquipmentBitSet flags) voidsetInstantModeSwitch(boolean b) voidSets the unique internal name and clears any set aliasvoidSets the modes that this type of equipment can be in.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface megamek.common.interfaces.ITechnology
calcEraAvailability, calcEraAvailability, calcYearAvailability, calcYearAvailability, calcYearAvailability, findMinimumRulesLevel, findMinimumRulesLevel, getAdvancedRange, getAdvancedRange, getCodeFromIOAbbr, getCodeFromMMAbbr, getCommonDate, getEraAvailabilityName, getEraAvailabilityName, getExperimentalRange, getExperimentalRange, getExtinctionRange, getExtinctionRange, getFullRatingName, getFullRatingName, getProductionDate, getPrototypeDate, getSimpleLevel, getSimpleLevel, getSimpleLevel, getStandardRange, getStandardRange, getTechRatingName, isAvailableIn, isAvailableIn, isAvailableIn, isExtinct, isExtinct, isExtinct, isLegal, isLegal
-
Field Details
-
TONNAGE_VARIABLE
public static final double TONNAGE_VARIABLE- See Also:
-
CRITICAL_SLOTS_VARIABLE
public static final int CRITICAL_SLOTS_VARIABLE- See Also:
-
BV_VARIABLE
public static final int BV_VARIABLE- See Also:
-
COST_VARIABLE
public static final int COST_VARIABLE- See Also:
-
T_ARMOR_UNKNOWN
public static final int T_ARMOR_UNKNOWN- See Also:
-
T_ARMOR_STANDARD
public static final int T_ARMOR_STANDARD- See Also:
-
T_ARMOR_FERRO_FIBROUS
public static final int T_ARMOR_FERRO_FIBROUS- See Also:
-
T_ARMOR_REACTIVE
public static final int T_ARMOR_REACTIVE- See Also:
-
T_ARMOR_REFLECTIVE
public static final int T_ARMOR_REFLECTIVE- See Also:
-
T_ARMOR_HARDENED
public static final int T_ARMOR_HARDENED- See Also:
-
T_ARMOR_LIGHT_FERRO
public static final int T_ARMOR_LIGHT_FERRO- See Also:
-
T_ARMOR_HEAVY_FERRO
public static final int T_ARMOR_HEAVY_FERRO- See Also:
-
T_ARMOR_PATCHWORK
public static final int T_ARMOR_PATCHWORK- See Also:
-
T_ARMOR_STEALTH
public static final int T_ARMOR_STEALTH- See Also:
-
T_ARMOR_FERRO_FIBROUS_PROTO
public static final int T_ARMOR_FERRO_FIBROUS_PROTO- See Also:
-
T_ARMOR_COMMERCIAL
public static final int T_ARMOR_COMMERCIAL- See Also:
-
T_ARMOR_LC_FERRO_CARBIDE
public static final int T_ARMOR_LC_FERRO_CARBIDE- See Also:
-
T_ARMOR_LC_LAMELLOR_FERRO_CARBIDE
public static final int T_ARMOR_LC_LAMELLOR_FERRO_CARBIDE- See Also:
-
T_ARMOR_LC_FERRO_IMP
public static final int T_ARMOR_LC_FERRO_IMP- See Also:
-
T_ARMOR_INDUSTRIAL
public static final int T_ARMOR_INDUSTRIAL- See Also:
-
T_ARMOR_HEAVY_INDUSTRIAL
public static final int T_ARMOR_HEAVY_INDUSTRIAL- See Also:
-
T_ARMOR_FERRO_LAMELLOR
public static final int T_ARMOR_FERRO_LAMELLOR- See Also:
-
T_ARMOR_PRIMITIVE
public static final int T_ARMOR_PRIMITIVE- See Also:
-
T_ARMOR_EDP
public static final int T_ARMOR_EDP- See Also:
-
T_ARMOR_ALUM
public static final int T_ARMOR_ALUM- See Also:
-
T_ARMOR_HEAVY_ALUM
public static final int T_ARMOR_HEAVY_ALUM- See Also:
-
T_ARMOR_LIGHT_ALUM
public static final int T_ARMOR_LIGHT_ALUM- See Also:
-
T_ARMOR_STEALTH_VEHICLE
public static final int T_ARMOR_STEALTH_VEHICLE- See Also:
-
T_ARMOR_ANTI_PENETRATIVE_ABLATION
public static final int T_ARMOR_ANTI_PENETRATIVE_ABLATION- See Also:
-
T_ARMOR_HEAT_DISSIPATING
public static final int T_ARMOR_HEAT_DISSIPATING- See Also:
-
T_ARMOR_IMPACT_RESISTANT
public static final int T_ARMOR_IMPACT_RESISTANT- See Also:
-
T_ARMOR_BALLISTIC_REINFORCED
public static final int T_ARMOR_BALLISTIC_REINFORCED- See Also:
-
T_ARMOR_FERRO_ALUM_PROTO
public static final int T_ARMOR_FERRO_ALUM_PROTO- See Also:
-
T_ARMOR_BA_STANDARD
public static final int T_ARMOR_BA_STANDARD- See Also:
-
T_ARMOR_BA_STANDARD_PROTOTYPE
public static final int T_ARMOR_BA_STANDARD_PROTOTYPE- See Also:
-
T_ARMOR_BA_STANDARD_ADVANCED
public static final int T_ARMOR_BA_STANDARD_ADVANCED- See Also:
-
T_ARMOR_BA_STEALTH_BASIC
public static final int T_ARMOR_BA_STEALTH_BASIC- See Also:
-
T_ARMOR_BA_STEALTH
public static final int T_ARMOR_BA_STEALTH- See Also:
-
T_ARMOR_BA_STEALTH_IMP
public static final int T_ARMOR_BA_STEALTH_IMP- See Also:
-
T_ARMOR_BA_STEALTH_PROTOTYPE
public static final int T_ARMOR_BA_STEALTH_PROTOTYPE- See Also:
-
T_ARMOR_BA_FIRE_RESIST
public static final int T_ARMOR_BA_FIRE_RESIST- See Also:
-
T_ARMOR_BA_MIMETIC
public static final int T_ARMOR_BA_MIMETIC- See Also:
-
T_ARMOR_BA_REFLECTIVE
public static final int T_ARMOR_BA_REFLECTIVE- See Also:
-
T_ARMOR_BA_REACTIVE
public static final int T_ARMOR_BA_REACTIVE- See Also:
-
T_ARMOR_PRIMITIVE_FIGHTER
public static final int T_ARMOR_PRIMITIVE_FIGHTER- See Also:
-
T_ARMOR_PRIMITIVE_AERO
public static final int T_ARMOR_PRIMITIVE_AERO- See Also:
-
T_ARMOR_AEROSPACE
public static final int T_ARMOR_AEROSPACE- See Also:
-
T_ARMOR_STANDARD_PROTOMEK
public static final int T_ARMOR_STANDARD_PROTOMEK- See Also:
-
T_ARMOR_SV_BAR_2
public static final int T_ARMOR_SV_BAR_2- See Also:
-
T_ARMOR_SV_BAR_3
public static final int T_ARMOR_SV_BAR_3- See Also:
-
T_ARMOR_SV_BAR_4
public static final int T_ARMOR_SV_BAR_4- See Also:
-
T_ARMOR_SV_BAR_5
public static final int T_ARMOR_SV_BAR_5- See Also:
-
T_ARMOR_SV_BAR_6
public static final int T_ARMOR_SV_BAR_6- See Also:
-
T_ARMOR_SV_BAR_7
public static final int T_ARMOR_SV_BAR_7- See Also:
-
T_ARMOR_SV_BAR_8
public static final int T_ARMOR_SV_BAR_8- See Also:
-
T_ARMOR_SV_BAR_9
public static final int T_ARMOR_SV_BAR_9- See Also:
-
T_ARMOR_SV_BAR_10
public static final int T_ARMOR_SV_BAR_10- See Also:
-
T_STRUCTURE_UNKNOWN
public static final int T_STRUCTURE_UNKNOWN- See Also:
-
T_STRUCTURE_STANDARD
public static final int T_STRUCTURE_STANDARD- See Also:
-
T_STRUCTURE_INDUSTRIAL
public static final int T_STRUCTURE_INDUSTRIAL- See Also:
-
T_STRUCTURE_ENDO_STEEL
public static final int T_STRUCTURE_ENDO_STEEL- See Also:
-
T_STRUCTURE_ENDO_PROTOTYPE
public static final int T_STRUCTURE_ENDO_PROTOTYPE- See Also:
-
T_STRUCTURE_REINFORCED
public static final int T_STRUCTURE_REINFORCED- See Also:
-
T_STRUCTURE_COMPOSITE
public static final int T_STRUCTURE_COMPOSITE- See Also:
-
T_STRUCTURE_ENDO_COMPOSITE
public static final int T_STRUCTURE_ENDO_COMPOSITE- See Also:
-
structureNames
-
structureAbbreviations
-
structureCosts
public static final double[] structureCosts -
name
-
shortName
-
internalName
-
sortingName
Sorting lists of equipment by this string groups and sorts equipment better. -
namesVector
-
tonnage
protected double tonnage -
criticalSlots
protected int criticalSlots -
tankSlots
protected int tankSlots -
svSlots
protected int svSlots -
explosive
protected boolean explosive -
hittable
protected boolean hittable -
spreadable
protected boolean spreadablecan the criticalSlots for this be spread over locations? -
toHitModifier
protected int toHitModifier -
techAdvancement
-
flags
-
bv
public double bv -
cost
protected double cost -
omniFixedOnly
protected boolean omniFixedOnly -
modes
what modes can this equipment be in? -
instantModeSwitch
protected boolean instantModeSwitchcan modes be switched instantly, or at end of turn? -
endTurnModes
sometimes some modes can be switched at the end of turn and some instantly In that case, the specific end of turn mode names can be added here -
allTypes
-
lookupHash
-
rulesRefs
Keeps track of page numbers for rules references. -
TA_STANDARD_STRUCTURE
-
TA_NONE
-
YAML_VERSION
- See Also:
-
VARIABLE
- See Also:
-
-
Constructor Details
-
EquipmentType
public EquipmentType()Creates new EquipmentType
-
-
Method Details
-
setFlags
-
getName
-
getName
-
getDesc
-
getBaseCost
public double getBaseCost() -
getBaseBV
public double getBaseBV() -
getBaseTonnage
public double getBaseTonnage() -
getBaseCriticalSlots
public double getBaseCriticalSlots() -
getDesc
-
getInternalName
-
getRulesRefs
-
getTechLevels
-
getTechLevel
public int getTechLevel(int date) - Specified by:
getTechLevelin interfaceITechnology
-
getTechLevel
public int getTechLevel(int date, boolean clan) - Specified by:
getTechLevelin interfaceITechnology
-
getStaticTechLevel
Description copied from interface:ITechnologyFor non-era-based usage, provide a single tech level that does not vary with date.- Specified by:
getStaticTechLevelin interfaceITechnology- Returns:
- The base rules level of the equipment or unit.
-
getTonnage
Calculates the weight of the equipment. Ifentityisnull, equipment without a fixed weight will returnTONNAGE_VARIABLE.- Parameters:
entity- The unit the equipment is mounted on- Returns:
- The weight of the equipment in tons
-
getTonnage
Calculates the weight of the equipment. Ifentityisnull, equipment without a fixed weight will returnTONNAGE_VARIABLE.- Parameters:
entity- The unit the equipment is mounted onsize- The size of variable-sized equipment- Returns:
- The weight of the equipment in tons
-
getTonnage
Calculates the weight of the equipment. Ifentityisnull, equipment without a fixed weight will returnTONNAGE_VARIABLE.- Parameters:
entity- The unit the equipment is mounted onlocation- The mount locationsize- The size (for variable-sized equipment)- Returns:
- The weight of the equipment in tons
-
getTonnage
Calculates the weight of the equipment, with the option to override the standard rounding based on unit type. This allows for the optional fractional accounting construction rules. Ifentityisnull, equipment without a fixed weight will returnTONNAGE_VARIABLE.- Parameters:
entity- The unit the equipment is mounted onlocation- The mount locationsize- The size (for variable-sized equipment)defaultMethod- The rounding method to use for any variable weight equipment. Any equipment that is normally rounded to either the half ton or kg based on unit type will have this method applied instead.- Returns:
- The weight of the equipment in tons
-
getNumCriticalSlots
-
getNumCriticalSlots
-
getTankSlots
-
getSupportVeeSlots
-
isExplosive
-
isExplosive
-
isHittable
public boolean isHittable() -
isSpreadable
public boolean isSpreadable() -
getToHitModifier
-
getToHitModifierAtRange
Returns the to-hit modifier for a range band. Equipment without a range-dependent modifier uses its regular mounted-equipment modifier. -
hasHitModifiersByRange
public boolean hasHitModifiersByRange()Returnstrueif this equipment has a range-based to-hit modifier. -
getFlags
-
hasFlag
Returns true when this EquipmentType has the given flag. NOTE: Even though EquipmentFlags are enums, checking e.g. a WeaponType if it has a MiscTypeFlag may return an incorrect true result, as the actual test is made using EquipmentBitSet, i.e. a number comparison.Example: EquipmentType.get("BAArmoredGlove").hasFlag(WeaponType.F_VGL) returns true, as WeaponType.F_VGL has the same ordinal as MiscType.F_ARMORED_GLOVE. Therefore, always make sure to test only MiscTypes against MiscTypeFlags, WeaponTypes against WeaponTypeFlags and AmmoTypes against AmmoTypeFlags. This method will log a warning if the rule is not followed.
- Parameters:
flag- The EquipmentFlag to check- Returns:
- True when this EquipmentType has the given flag
- See Also:
-
hasAnyFlag
- Returns:
- True when the equipment has at least one of the given flags.
-
hasAnyFlag
- Returns:
- True when the equipment has at least one of the given flags.
-
hasFlag
Checks if the equipment has all the specified flags.- Parameters:
flag- The flags to check- Returns:
- True if the equipment has all the specified flags
-
getBV
-
isOmniFixedOnly
public boolean isOmniFixedOnly()- Returns:
- - whether the equipment must be considered part of the base chassis when mounted on an omni unit
-
hasModes
public boolean hasModes()- Returns:
trueif this type of equipment has set of modes that it can be in.
-
hasModeType
Simple way to check if a piece of equipment has a specific usage/firing mode- Parameters:
modeType- The name of the mode to check.- Returns:
- True or false.
-
getModesCount
- Parameters:
mounted- The equipment mount. In some cases the modes are affected by linked equipment.- Returns:
- the number of modes that this type of equipment can be in or
0if it doesn't have modes.
-
getModesCount
public int getModesCount()- Returns:
- the number of modes that this type of equipment can be in or
0if it doesn't have modes.
-
getModes
- Returns:
Enumerationof theEquipmentModethat this type of equipment can be in
-
setModes
Sets the modes that this type of equipment can be in. By default, the EquipmentType doesn't have the modes, so don't try to call this method with null or empty argument. TODO: Refactor so the equipment knows the phase they can be armed/disarmed- Parameters:
modes- non-null, non-empty list of available mode names.
-
removeMode
Remove a specific mode from the list of modes. -
addMode
Add a mode to the Equipment TODO: Refactor so the equipment knows the phase they can be armed/disarmed- Parameters:
mode- The mode to be added- Returns:
- true if the mode was added; false if modes was null or the mode was already present
-
clearModes
protected void clearModes()Clears the modes that this type of equipment can be in. This is useful where a subtype such as Streak LRMs has no modes, but the supertype of that type such as standard LRMs has modes that do not apply to the subtype -
addEndTurnMode
-
isNextTurnModeSwitch
Some equipment types might have both instant and next turn mode switching. This method checks for end of turn modes that are kept in a vector of names. It is used by theMounted.setMode(int)method to distinguish instant and end of turn switching.- Parameters:
mode- - theStringof the mode name involved in the switch- Returns:
- true if the mode name is found in the next turn mode vector
-
getMode
Returns the mode number
modeNumfrom the list of modes available for this type of equipment. Modes are numbered from0togetModesCount() - 1Fails if this type of the equipment doesn't have modes, or given mode is out of the valid range.
- Returns:
- mode number
modeNumfrom the list of modes available for this type of equipment. - See Also:
-
setInstantModeSwitch
public void setInstantModeSwitch(boolean b) -
hasInstantModeSwitch
public boolean hasInstantModeSwitch() -
setInternalName
Sets the unique internal name and clears any set alias -
addLookupName
-
addLookupName
-
clearLookupNames
protected void clearLookupNames()Clears lookup identity inherited from a superclass constructor. This must only be used before the equipment type is registered. -
get
Returns an EquipmentType having the given internal name or lookup name (but not the "name" which is the display text unless it's equal to the internal name). Internal names may be taken fromEquipmentTypeLookup. Returns null if there is none with that name.- Parameters:
key- The internal name or lookup name- Returns:
- The EquipmentType with the given internal name or lookup name
-
get
Returns an equipment type by lookup name, preferring the requested tech base when an unqualified display name is shared by multiple equipment types.- Parameters:
key- The internal name, lookup name, or display nametechBase- The preferred tech base for an ambiguous display name- Returns:
- The matching equipment type, or null if there is none
-
getStructureFromName
Explicit structure lookup by name- Parameters:
key- String name- Returns:
- The matching Structure-specific Equipment Type.
-
getArmorFromName
Explicit armor lookup by name- Parameters:
key- String name- Returns:
- The matching Armor-specific Equipment Type, or null when the name is unknown
-
getLookupCollisions
- Returns:
- A snapshot of lookup names registered by more than one equipment type.
-
matchesName
Add a way to find if a given equipment type matches a particular string in _any_ of its names (Case sensitive) -
getNames
-
initializeTypes
public static void initializeTypes() -
getAllTypes
-
allTypes
- Returns:
- All equipment types as a List. The list is a copy and can safely be modified.
-
addType
-
getArmorType
-
getArmorTypeName
-
getArmorTypeName
-
isArmorType
Convenience method to test whether an EquipmentType instance is armor.- Parameters:
et- The equipment instance to test- Returns:
- Whether the equipment is an armor type
-
getStructureType
-
getStructureTypeName
-
getStructureTypeName
-
getStructureTypeAbbrev
-
isStructureType
Convenience method to test whether an EquipmentType instance is mek structure. This works by comparing the results ofgetName()to the structure names array and returningtrueif there is a match.- Parameters:
et- The equipment instance to test- Returns:
- Whether the equipment is a structure type
-
getStructureTechAdvancement
-
getCost
For variable-sized equipment this assumes a size of 1.0.- Returns:
- The C-Bill cost of the piece of equipment.
-
getCost
- Returns:
- The C-Bill cost of the piece of equipment.
-
getRawCost
public double getRawCost() -
isVariableTonnage
public boolean isVariableTonnage()- Returns:
- Whether the item weight varies according to the unit it's installed on
-
isVariableBV
public boolean isVariableBV()- Returns:
- Whether the item BV varies according to the unit it's installed on
-
isVariableCost
public boolean isVariableCost()- Returns:
- Whether the item cost varies according to the unit it's installed on
-
isVariableCriticalSlots
public boolean isVariableCriticalSlots() -
isVariableSize
public boolean isVariableSize()- Returns:
- Whether the item's size is variable independent of external factors
-
variableStepSize
- Returns:
- The increment between sizes of variable-sized equipment
-
variableMaxSize
- Returns:
- The maximum size of variable-sized equipment. Items with no maximum return
null.
-
getTechAdvancement
-
getTechRating
- Specified by:
getTechRatingin interfaceITechnology
-
isClan
public boolean isClan()- Specified by:
isClanin interfaceITechnology
-
isMixedTech
public boolean isMixedTech()- Specified by:
isMixedTechin interfaceITechnology
-
getTechBase
- Specified by:
getTechBasein interfaceITechnology
-
getEquipDateAsString
Deprecated, for removal: This API element is subject to removal in a future version. -
getIntroductionDate
public int getIntroductionDate(boolean clan) - Specified by:
getIntroductionDatein interfaceITechnology
-
getIntroductionDate
public int getIntroductionDate()- Specified by:
getIntroductionDatein interfaceITechnology
-
getIntroductionDate
- Specified by:
getIntroductionDatein interfaceITechnology
-
getExtinctionDate
public int getExtinctionDate(boolean clan) - Specified by:
getExtinctionDatein interfaceITechnology
-
getExtinctionDate
public int getExtinctionDate()- Specified by:
getExtinctionDatein interfaceITechnology
-
getExtinctionDate
- Specified by:
getExtinctionDatein interfaceITechnology
-
getReintroductionDate
public int getReintroductionDate(boolean clan) - Specified by:
getReintroductionDatein interfaceITechnology
-
getReintroductionDate
public int getReintroductionDate()- Specified by:
getReintroductionDatein interfaceITechnology
-
getReintroductionDate
- Specified by:
getReintroductionDatein interfaceITechnology
-
getStructureCost
public static double getStructureCost(int inStructure) -
equals
-
hashCode
public int hashCode() -
getYamlData
Constructs a map containing the YAML-serializable data for this equipment type. Subclasses should override this method to add type-specific data.- Returns:
- A map containing the YAML-serializable data for this equipment type.
-
getYamlTypeName
Returns the YAML type name for this equipment type. Subclasses should override this to return their specific type name.- Returns:
- The YAML type name (e.g., "weapon", "ammo", "misc", "armor")
-
addFlags
Adds equipment flags to the YAML data map. Subclasses should override this to add type-specific flags.- Parameters:
data- The YAML data map to add flags to
-
toString
-
getShortName
-
getShortName
-
isIntroLevel
public boolean isIntroLevel()- Specified by:
isIntroLevelin interfaceITechnology
-
isUnofficial
public boolean isUnofficial()- Specified by:
isUnofficialin interfaceITechnology
-
getPrototypeDate
public int getPrototypeDate()- Specified by:
getPrototypeDatein interfaceITechnology
-
getPrototypeDate
- Specified by:
getPrototypeDatein interfaceITechnology
-
getProductionDate
public int getProductionDate()- Specified by:
getProductionDatein interfaceITechnology
-
getProductionDate
- Specified by:
getProductionDatein interfaceITechnology
-
getCommonDate
public int getCommonDate()- Specified by:
getCommonDatein interfaceITechnology
-
getBaseAvailability
- Specified by:
getBaseAvailabilityin interfaceITechnology
-
getHeat
public int getHeat()This does not include heat generated by stealth armor, as that depends on whether it is installed as patchwork and does not appear in the equipment list of all unit types.- Returns:
- The amount of heat generated by the equipment
-
getSortingName
Sorting with the String returned by this method results in an improved ordering and grouping of equipment than by getName(); for example, AC2/5/10/20 will appear in that order instead of the order AC10/2/20/5 and S/M/L Lasers will be grouped together.- Returns:
- A String similar to getName() but modified to support a better sorting
-
isAnyOf
Returns true if this equipment is any of those identified by the given type Strings. The given typeInternalNames are compared to the internal name of this EquipmentType, not the (display) name!Best use the constants defined in EquipmentTypeLookup.
- Parameters:
typeInternalName- An Equipment internal name to checktypeInternalNames- More Equipment internal names to check- Returns:
- true if the internalName of this equipment matches any of the given types
-
is
Returns true if this equipment is that identified by the given typeInternalName String. The given typeInternalName is compared to the internal name of this EquipmentType, not the (display) name!Best use the constants defined in EquipmentTypeLookup. Calling this is equivalent to
isAnyOf(String, String...)with only the one parameter.- Parameters:
typeInternalName- An Equipment internal name to check- Returns:
- true if the internalName of this equipment matches the given type
-
getAllStructureCodeName
-
isEligibleForBeingArmored
public boolean isEligibleForBeingArmored()- Returns:
- True if this equipment type is eligible for being an armored component, TO:AUE p.95
-
isC3Equipment
public boolean isC3Equipment()- Returns:
- True if this equipment type is any type of C3 equipment, meaning C3S/M and variations of those, C3i, Nova CEWS, NC3 and BA C3. Note that this returns true for some MiscTypes as well as some WeaponTypes.
-
canBeMountedOnBaDwp
public boolean canBeMountedOnBaDwp()- Returns:
- True if this equipment type can be mounted on a BattleArmor Detachable Weapon Pack, TO:AUE p.99
-
relevantToTargetingComputer
public boolean relevantToTargetingComputer()- Returns:
- True if this equipment counts for the size and weight of a Targeting Computer, and benefits from it in the case of weapons. TM p.238, TO:AUE p.157
-