Class TechConstants

java.lang.Object
megamek.common.TechConstants

public class TechConstants extends Object
Contains some constants representing equipment/unit tech levels
Since:
June 11, 2002, 4:35 PM
  • Field Details

  • Constructor Details

    • TechConstants

      public TechConstants()
  • Method Details

    • getLevelName

      public static String getLevelName(int level)
    • getLevelDisplayableName

      public static String getLevelDisplayableName(int level)
      Get the displayable name for the given tech level.
    • getSimpleLevelName

      public static String getSimpleLevelName(int level)
    • getSimpleLevel

      public static int getSimpleLevel(String simpleLevel)
      Return the numeric value for a simple level name. This is necessary because the options get stored as Strings instead of ints, but it's easier to compare ints.
    • getTechLevel

      public static int getTechLevel(String techLevel)
      Return the numeric value for a simple level name. This is necessary because the options get stored as Strings instead of ints, but it's easier to compare ints.
    • getSimpleLevel

      public static int getSimpleLevel(Game game)
      Parameters:
      game - The current Game
      Returns:
      the Game's tech level as an integer.
    • convertFromSimpleLevel

      public static int convertFromSimpleLevel(int simpleTechLvl, boolean isClan)
      Given a simple tech level and a tech base, convert to the lvl+base format
    • getGameTechLevel

      public static int getGameTechLevel(Game game, boolean isClan)
      Use the game's simple tech level and a flag to return the tech level + tech type.
      Parameters:
      game - The current Game
      isClan - if the tech base is clan
      Returns:
      Tech Level and Type magic number to use for the current Game
    • convertFromNormalToSimple

      public static int convertFromNormalToSimple(int techLevel)
    • isLegal

      public static boolean isLegal(int entityTechLevel, int equipmentTechLevel, boolean mixed)
      Returns true if the equipment is legal for a unit with the paired tech levels; Returns false if it is not.
    • isLegal

      public static boolean isLegal(int entityTechLevel, int equipmentTechLevel, boolean ignoreUnknown, boolean mixed)
      Returns true if the equipment is legal for a unit with the paired tech levels; Returns false if it is not.
    • getTechName

      public static String getTechName(int level)
    • isClan

      public static boolean isClan(int level)
    • getOppositeTechLevel

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

      @Deprecated(since="0.51.0", forRemoval=true) public static int getGyroTechLevel(int gyroType, boolean isClan, int year)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return the tech level of the given gyro. This is necessary because gyros are systems and hence don't have MiscType entries.
    • getCockpitTechLevel

      @Deprecated(since="0.51.0", forRemoval=true) public static int getCockpitTechLevel(int cockpitType, long entityType, boolean isClan, int year)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Return the tech level of the given cockpit. THis is necessary because cockpits are systems and hence don't have MiscType entries.