Package megamek.common
Class TechConstants
java.lang.Object
megamek.common.TechConstants
Contains some constants representing equipment/unit tech levels
- Since:
- June 11, 2002, 4:35 PM
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic 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 intThese simple versions don't incorporate tech base (clan/is), and just represent a rules level.static final String[]static final String[]static final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intconvertFromNormalToSimple(int techLevel) static intconvertFromSimpleLevel(int simpleTechLvl, boolean isClan) Given a simple tech level and a tech base, convert to the lvl+base formatstatic intgetCockpitTechLevel(int cockpitType, long entityType, boolean isClan, int year) Deprecated, for removal: This API element is subject to removal in a future version.static intgetGameTechLevel(Game game, boolean isClan) Use the game's simple tech level and a flag to return the tech level + tech type.static intgetGyroTechLevel(int gyroType, boolean isClan, int year) Deprecated, for removal: This API element is subject to removal in a future version.static StringgetLevelDisplayableName(int level) Get the displayable name for the given tech level.static StringgetLevelName(int level) static intgetOppositeTechLevel(int level) Deprecated, for removal: This API element is subject to removal in a future version.static intgetSimpleLevel(String simpleLevel) Return the numeric value for a simple level name.static intgetSimpleLevel(Game game) static StringgetSimpleLevelName(int level) static intgetTechLevel(String techLevel) Return the numeric value for a simple level name.static StringgetTechName(int level) static booleanisClan(int level) static booleanisLegal(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.static booleanisLegal(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.
-
Field Details
-
T_ALLOWED_ALL
public static final int T_ALLOWED_ALL- See Also:
-
T_TECH_UNKNOWN
public static final int T_TECH_UNKNOWN- See Also:
-
T_INTRO_BOX_SET
public static final int T_INTRO_BOX_SET- See Also:
-
T_IS_TW_NON_BOX
public static final int T_IS_TW_NON_BOX- See Also:
-
T_CLAN_TW
public static final int T_CLAN_TW- See Also:
-
T_IS_TW_ALL
public static final int T_IS_TW_ALL- See Also:
-
T_TW_ALL
public static final int T_TW_ALL- See Also:
-
T_IS_ADVANCED
public static final int T_IS_ADVANCED- See Also:
-
T_CLAN_ADVANCED
public static final int T_CLAN_ADVANCED- See Also:
-
T_IS_EXPERIMENTAL
public static final int T_IS_EXPERIMENTAL- See Also:
-
T_CLAN_EXPERIMENTAL
public static final int T_CLAN_EXPERIMENTAL- See Also:
-
T_IS_UNOFFICIAL
public static final int T_IS_UNOFFICIAL- See Also:
-
T_CLAN_UNOFFICIAL
public static final int T_CLAN_UNOFFICIAL- See Also:
-
T_ALL_IS
public static final int T_ALL_IS- See Also:
-
T_ALL_CLAN
public static final int T_ALL_CLAN- See Also:
-
T_ALL
public static final int T_ALL- See Also:
-
SIZE_LEVEL_2
public static final int SIZE_LEVEL_2- See Also:
-
SIZE
public static final int SIZE -
T_SIMPLE_INTRO
public static final int T_SIMPLE_INTROThese simple versions don't incorporate tech base (clan/is), and just represent a rules level.- See Also:
-
T_SIMPLE_STANDARD
public static final int T_SIMPLE_STANDARD- See Also:
-
T_SIMPLE_ADVANCED
public static final int T_SIMPLE_ADVANCED- See Also:
-
T_SIMPLE_EXPERIMENTAL
public static final int T_SIMPLE_EXPERIMENTAL- See Also:
-
T_SIMPLE_UNOFFICIAL
public static final int T_SIMPLE_UNOFFICIAL- See Also:
-
T_SIMPLE_NAMES
-
SIMPLE_SIZE
public static final int SIMPLE_SIZE -
T_SIMPLE_LEVEL
-
-
Constructor Details
-
TechConstants
public TechConstants()
-
-
Method Details
-
getLevelName
-
getLevelDisplayableName
Get the displayable name for the given tech level. -
getSimpleLevelName
-
getSimpleLevel
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
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
- Parameters:
game- The currentGame- 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
Use the game's simple tech level and a flag to return the tech level + tech type. -
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
-
isClan
public static boolean isClan(int level) -
getOppositeTechLevel
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.
-