Class EquipmentType

java.lang.Object
megamek.common.equipment.EquipmentType
All Implemented Interfaces:
ITechnology
Direct Known Subclasses:
AmmoType, MiscType, WeaponType

public class EquipmentType extends Object implements ITechnology
Represents any type of equipment mounted on a 'Mek, excluding systems and actuators.
Since:
April 1, 2002, 1:35 PM
  • 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

      public static final String[] structureNames
    • structureAbbreviations

      public static final String[] structureAbbreviations
    • structureCosts

      public static final double[] structureCosts
    • name

      protected String name
    • shortName

      protected String shortName
    • internalName

      protected String internalName
    • sortingName

      protected String sortingName
      Sorting lists of equipment by this string groups and sorts equipment better.
    • namesVector

      protected Vector<String> 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 spreadable
      can the criticalSlots for this be spread over locations?
    • toHitModifier

      protected int toHitModifier
    • techAdvancement

      protected TechAdvancement techAdvancement
    • flags

      protected EquipmentBitSet flags
    • bv

      public double bv
    • cost

      protected double cost
    • omniFixedOnly

      protected boolean omniFixedOnly
    • modes

      protected final Vector<EquipmentMode> modes
      what modes can this equipment be in?
    • instantModeSwitch

      protected boolean instantModeSwitch
      can modes be switched instantly, or at end of turn?
    • endTurnModes

      public Vector<String> 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

      protected static Vector<EquipmentType> allTypes
    • lookupHash

      protected static Hashtable<String,EquipmentType> lookupHash
    • rulesRefs

      protected String rulesRefs
      Keeps track of page numbers for rules references.
    • TA_STANDARD_STRUCTURE

      protected static final TechAdvancement TA_STANDARD_STRUCTURE
    • TA_NONE

      protected static final TechAdvancement TA_NONE
    • YAML_VERSION

      public static final String YAML_VERSION
      See Also:
    • VARIABLE

      public static final String VARIABLE
      See Also:
  • Constructor Details

    • EquipmentType

      public EquipmentType()
      Creates new EquipmentType
  • Method Details

    • setFlags

      public void setFlags(EquipmentBitSet flags)
    • getName

      public String getName()
    • getName

      public String getName(double size)
    • getDesc

      public String getDesc()
    • getBaseCost

      public double getBaseCost()
    • getBaseBV

      public double getBaseBV()
    • getBaseTonnage

      public double getBaseTonnage()
    • getBaseCriticalSlots

      public double getBaseCriticalSlots()
    • getDesc

      public String getDesc(double size)
    • getInternalName

      public String getInternalName()
    • getRulesRefs

      public String getRulesRefs()
    • getTechLevels

      public Map<Integer,Integer> getTechLevels()
    • getTechLevel

      public int getTechLevel(int date)
      Specified by:
      getTechLevel in interface ITechnology
    • getTechLevel

      public int getTechLevel(int date, boolean clan)
      Specified by:
      getTechLevel in interface ITechnology
    • getStaticTechLevel

      public SimpleTechLevel getStaticTechLevel()
      Description copied from interface: ITechnology
      For non-era-based usage, provide a single tech level that does not vary with date.
      Specified by:
      getStaticTechLevel in interface ITechnology
      Returns:
      The base rules level of the equipment or unit.
    • getTonnage

      public double getTonnage(@Nullable Entity entity)
      Calculates the weight of the equipment. If entity is null, equipment without a fixed weight will return TONNAGE_VARIABLE.
      Parameters:
      entity - The unit the equipment is mounted on
      Returns:
      The weight of the equipment in tons
    • getTonnage

      public double getTonnage(@Nullable Entity entity, double size)
      Calculates the weight of the equipment. If entity is null, equipment without a fixed weight will return TONNAGE_VARIABLE.
      Parameters:
      entity - The unit the equipment is mounted on
      size - The size of variable-sized equipment
      Returns:
      The weight of the equipment in tons
    • getTonnage

      public double getTonnage(Entity entity, int location, double size)
      Calculates the weight of the equipment. If entity is null, equipment without a fixed weight will return TONNAGE_VARIABLE.
      Parameters:
      entity - The unit the equipment is mounted on
      location - The mount location
      size - The size (for variable-sized equipment)
      Returns:
      The weight of the equipment in tons
    • getTonnage

      public double getTonnage(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. This allows for the optional fractional accounting construction rules. If entity is null, equipment without a fixed weight will return TONNAGE_VARIABLE.
      Parameters:
      entity - The unit the equipment is mounted on
      location - The mount location
      size - 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

      public int getNumCriticalSlots(Entity entity)
    • getNumCriticalSlots

      public int getNumCriticalSlots(Entity entity, double size)
    • getTankSlots

      public int getTankSlots(Entity entity)
    • getSupportVeeSlots

      public int getSupportVeeSlots(Entity entity)
    • isExplosive

      public boolean isExplosive(Mounted<?> mounted)
    • isExplosive

      public boolean isExplosive(Mounted<?> mounted, boolean ignoreCharge)
    • isHittable

      public boolean isHittable()
    • isSpreadable

      public boolean isSpreadable()
    • getToHitModifier

      public int getToHitModifier(@Nullable Mounted<?> mounted)
    • getToHitModifierAtRange

      public int getToHitModifierAtRange(@Nullable Mounted<?> mounted, int range)
      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()
      Returns true if this equipment has a range-based to-hit modifier.
    • getFlags

      public EquipmentBitSet getFlags()
    • hasFlag

      public boolean hasFlag(EquipmentFlag flag)
      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

      public boolean hasAnyFlag(EquipmentFlag... flags)
      Returns:
      True when the equipment has at least one of the given flags.
    • hasAnyFlag

      public boolean hasAnyFlag(EquipmentBitSet mask)
      Returns:
      True when the equipment has at least one of the given flags.
    • hasFlag

      public boolean hasFlag(EquipmentBitSet flag)
      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

      public double getBV(Entity entity)
    • 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:
      true if this type of equipment has set of modes that it can be in.
    • hasModeType

      public boolean hasModeType(String modeType)
      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

      public int getModesCount(Mounted<?> mounted)
      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 0 if it doesn't have modes.
    • getModesCount

      public int getModesCount()
      Returns:
      the number of modes that this type of equipment can be in or 0 if it doesn't have modes.
    • getModes

      public Enumeration<EquipmentMode> getModes()
      Returns:
      Enumeration of the EquipmentMode that this type of equipment can be in
    • setModes

      public void setModes(String... modes)
      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

      public boolean removeMode(String mode)
      Remove a specific mode from the list of modes.
    • addMode

      public boolean addMode(String mode)
      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

      public void addEndTurnMode(String mode)
    • isNextTurnModeSwitch

      public boolean isNextTurnModeSwitch(String mode)
      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 the Mounted.setMode(int) method to distinguish instant and end of turn switching.
      Parameters:
      mode - - the String of the mode name involved in the switch
      Returns:
      true if the mode name is found in the next turn mode vector
    • getMode

      public EquipmentMode getMode(int modeNum)

      Returns the mode number modeNum from the list of modes available for this type of equipment. Modes are numbered from 0 to getModesCount() - 1

      Fails if this type of the equipment doesn't have modes, or given mode is out of the valid range.

      Returns:
      mode number modeNum from the list of modes available for this type of equipment.
      See Also:
    • setInstantModeSwitch

      public void setInstantModeSwitch(boolean b)
    • hasInstantModeSwitch

      public boolean hasInstantModeSwitch()
    • setInternalName

      public void setInternalName(String s)
      Sets the unique internal name and clears any set alias
    • addLookupName

      public void addLookupName(String s)
    • addLookupName

      public void addLookupName(String s, boolean includeInNames)
    • clearLookupNames

      protected void clearLookupNames()
      Clears lookup identity inherited from a superclass constructor. This must only be used before the equipment type is registered.
    • get

      @Nullable public static EquipmentType get(String key)
      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 from EquipmentTypeLookup. 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

      @Nullable public static EquipmentType get(String key, @Nullable TechBase techBase)
      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 name
      techBase - The preferred tech base for an ambiguous display name
      Returns:
      The matching equipment type, or null if there is none
    • getStructureFromName

      @Nullable public static StructureType getStructureFromName(String key)
      Explicit structure lookup by name
      Parameters:
      key - String name
      Returns:
      The matching Structure-specific Equipment Type.
    • getArmorFromName

      @Nullable public static ArmorType getArmorFromName(String key)
      Explicit armor lookup by name
      Parameters:
      key - String name
      Returns:
      The matching Armor-specific Equipment Type, or null when the name is unknown
    • getLookupCollisions

      public static Map<String,Set<EquipmentType>> getLookupCollisions()
      Returns:
      A snapshot of lookup names registered by more than one equipment type.
    • matchesName

      public boolean matchesName(String name)
      Add a way to find if a given equipment type matches a particular string in _any_ of its names (Case sensitive)
    • getNames

      public Enumeration<String> getNames()
    • initializeTypes

      public static void initializeTypes()
    • getAllTypes

      public static Enumeration<EquipmentType> getAllTypes()
    • allTypes

      public static List<EquipmentType> allTypes()
      Returns:
      All equipment types as a List. The list is a copy and can safely be modified.
    • addType

      protected static void addType(EquipmentType type)
    • getArmorType

      public static int getArmorType(EquipmentType et)
    • getArmorTypeName

      public static String getArmorTypeName(int armorType)
    • getArmorTypeName

      public static String getArmorTypeName(int armorType, boolean clan)
    • isArmorType

      public static boolean isArmorType(EquipmentType et)
      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

      public static int getStructureType(EquipmentType et)
    • getStructureTypeName

      public static String getStructureTypeName(int structureType)
    • getStructureTypeName

      public static String getStructureTypeName(int structureType, boolean clan)
    • getStructureTypeAbbrev

      public static String getStructureTypeAbbrev(int structureType)
    • isStructureType

      public static boolean isStructureType(EquipmentType et)
      Convenience method to test whether an EquipmentType instance is mek structure. This works by comparing the results of getName() to the structure names array and returning true if there is a match.
      Parameters:
      et - The equipment instance to test
      Returns:
      Whether the equipment is a structure type
    • getStructureTechAdvancement

      public static TechAdvancement getStructureTechAdvancement(int at, boolean clan)
    • getCost

      public double getCost(Entity entity, boolean armored, int loc)
      For variable-sized equipment this assumes a size of 1.0.
      Returns:
      The C-Bill cost of the piece of equipment.
    • getCost

      public double getCost(Entity entity, boolean armored, int loc, double size)
      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

      public Double variableStepSize()
      Returns:
      The increment between sizes of variable-sized equipment
    • variableMaxSize

      @Nullable public Double variableMaxSize()
      Returns:
      The maximum size of variable-sized equipment. Items with no maximum return null.
    • getTechAdvancement

      public TechAdvancement getTechAdvancement()
    • getTechRating

      public TechRating getTechRating()
      Specified by:
      getTechRating in interface ITechnology
    • isClan

      public boolean isClan()
      Specified by:
      isClan in interface ITechnology
    • isMixedTech

      public boolean isMixedTech()
      Specified by:
      isMixedTech in interface ITechnology
    • getTechBase

      public TechBase getTechBase()
      Specified by:
      getTechBase in interface ITechnology
    • getEquipDateAsString

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

      public int getIntroductionDate(boolean clan)
      Specified by:
      getIntroductionDate in interface ITechnology
    • getIntroductionDate

      public int getIntroductionDate()
      Specified by:
      getIntroductionDate in interface ITechnology
    • getIntroductionDate

      public int getIntroductionDate(boolean clan, Faction faction)
      Specified by:
      getIntroductionDate in interface ITechnology
    • getExtinctionDate

      public int getExtinctionDate(boolean clan)
      Specified by:
      getExtinctionDate in interface ITechnology
    • getExtinctionDate

      public int getExtinctionDate()
      Specified by:
      getExtinctionDate in interface ITechnology
    • getExtinctionDate

      public int getExtinctionDate(boolean clan, Faction faction)
      Specified by:
      getExtinctionDate in interface ITechnology
    • getReintroductionDate

      public int getReintroductionDate(boolean clan)
      Specified by:
      getReintroductionDate in interface ITechnology
    • getReintroductionDate

      public int getReintroductionDate()
      Specified by:
      getReintroductionDate in interface ITechnology
    • getReintroductionDate

      public int getReintroductionDate(boolean clan, Faction faction)
      Specified by:
      getReintroductionDate in interface ITechnology
    • getStructureCost

      public static double getStructureCost(int inStructure)
    • equals

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

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

      public Map<String,Object> 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

      protected String 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

      protected void addFlags(Map<String,Object> data)
      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

      public String toString()
      Overrides:
      toString in class Object
    • getShortName

      public String getShortName()
    • getShortName

      public String getShortName(double size)
    • isIntroLevel

      public boolean isIntroLevel()
      Specified by:
      isIntroLevel in interface ITechnology
    • isUnofficial

      public boolean isUnofficial()
      Specified by:
      isUnofficial in interface ITechnology
    • getPrototypeDate

      public int getPrototypeDate()
      Specified by:
      getPrototypeDate in interface ITechnology
    • getPrototypeDate

      public int getPrototypeDate(boolean clan, Faction faction)
      Specified by:
      getPrototypeDate in interface ITechnology
    • getProductionDate

      public int getProductionDate()
      Specified by:
      getProductionDate in interface ITechnology
    • getProductionDate

      public int getProductionDate(boolean clan, Faction faction)
      Specified by:
      getProductionDate in interface ITechnology
    • getCommonDate

      public int getCommonDate()
      Specified by:
      getCommonDate in interface ITechnology
    • getBaseAvailability

      public AvailabilityValue getBaseAvailability(Era era)
      Specified by:
      getBaseAvailability in interface ITechnology
    • 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

      public String 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

      public boolean isAnyOf(String typeInternalName, String... typeInternalNames)
      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 check
      typeInternalNames - More Equipment internal names to check
      Returns:
      true if the internalName of this equipment matches any of the given types
    • is

      public boolean is(String typeInternalName)
      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

      public static Map<Integer,String> 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