Class RangeType

java.lang.Object
megamek.common.RangeType

public class RangeType extends Object
  • Field Details

  • Constructor Details

    • RangeType

      public RangeType(int r_min, int r_short, int r_med, int r_long, int r_extreme)
    • RangeType

      public RangeType(int r_short, int r_med, int r_long, int r_extreme)
    • RangeType

      public RangeType(int r_short, int r_med, int r_long)
  • Method Details

    • getRangeID

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

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

      public static int rangeBracket(int distance, int[] ranges, boolean useExtremeRange, boolean useLOSRange)
      Returns the range bracket a distance falls into.
      Parameters:
      distance - - the distance to the target
      ranges - - the array of distances of the weapon
      useExtremeRange - - true if extreme range rules should be used
      useLOSRange - - true if LOS range rules should be used
      Returns:
      the constant for the range bracket
    • rangeBracketC3

      public static int rangeBracketC3(int c3SpotterDistance, int attackerDistance, int[] ranges, boolean useExtremeRange, boolean useLOSRange)
      Returns the range bracket considering C3 network data.
      Parameters:
      c3SpotterDistance - - the distance from the spotter to the target
      attackerDistance - - the distance from the attacker to the target
      ranges - - the array of distances of the weapon
      useExtremeRange - - true if extreme range rules should be used
      useLOSRange - - true if LOS range rules should be used
      Returns:
      the constant for the range bracket