Enum Class AerospaceVenue

java.lang.Object
java.lang.Enum<AerospaceVenue>
megamek.client.bot.princess.AerospaceVenue
All Implemented Interfaces:
Serializable, Comparable<AerospaceVenue>, Constable

public enum AerospaceVenue extends Enum<AerospaceVenue>
Which set of atmospheric aerospace rules a unit is flying under.

Aerospace units on ground mapsheets still fly "as though they were moving on the low-altitude map" (TW p.91) - same altitudes, never elevations - but the hexes underneath them are a different size, and almost every derived quantity changes with it. A ground map hex is 30 metres; a low-altitude hex is 500, roughly a whole ground map. That is the 16-to-one ratio the game uses to translate between them (TW p.92).

The two venues diverge far enough that treating them as one case is what produced the bot's current aerospace behaviour. Naming the venue makes each divergence a deliberate branch instead of a scattered isAirborneAeroOnGroundMap() test:

  • Turning - a low-altitude fighter buys a facing change for ceil(velocity/2) thrust. On a ground map it must first fly 8 to 52 hexes in a straight line, depending on velocity and class (TW p.92). Facing is close to unusable within a single turn; altitude is not.
  • Reach - one velocity point carries a low-altitude fighter one hex, and a ground-map fighter sixteen (TW p.92).
  • The dead zone - measured in low-altitude hexes either way, so on a ground map it covers sixteen times the ground. One altitude of separation costs a low-altitude fighter two hexes of approach and a ground-map fighter seventeen.
  • Enum Constant Details

    • GROUND_MAP

      public static final AerospaceVenue GROUND_MAP
      Flying directly over a ground mapsheet, under the Aerospace Units on Ground Mapsheets rules (TW p.91).
    • LOW_ALTITUDE

      public static final AerospaceVenue LOW_ALTITUDE
      Flying on a low-altitude map, with or without terrain beneath it.
  • Field Details

    • GROUND_HEXES_PER_LOW_ALTITUDE_HEX

      public static final int GROUND_HEXES_PER_LOW_ALTITUDE_HEX
      Ground map hexes spanned by one low-altitude hex.

      The map scales are 30 metres and 500 metres respectively, so the true ratio is nearer seventeen, but the game rounds it to sixteen and uses that everywhere - one velocity point moves a ground-map fighter sixteen hexes (TW p.92), and Compute.effectiveDistance divides by the same figure.

      See Also:
  • Method Details

    • values

      public static AerospaceVenue[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AerospaceVenue valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static AerospaceVenue of(Game game, Entity entity)
      The venue an airborne aerospace unit is currently flying under.
      Parameters:
      game - the current game
      entity - the unit to place
      Returns:
      GROUND_MAP when the unit is an airborne aero over a ground mapsheet, otherwise LOW_ALTITUDE
    • isGroundMap

      public boolean isGroundMap()
      Returns:
      true when this is the ground mapsheet venue
    • hexesPerVelocityPoint

      public int hexesPerVelocityPoint()
      How far one point of velocity carries an aerodyne unit here, in hexes of this venue's own map (TW p.92).
      Returns:
      16 on a ground mapsheet, 1 at low altitude
    • toEngagementRange

      public int toEngagementRange(int hexDistance)
      Converts a hex distance measured on this venue's map into the low-altitude hexes that aerospace range, bracket and dead-zone rules are written in.

      Rounds up, matching the engine's own conversion in Compute.effectiveDistance. The rounding is not cosmetic: on a ground map it decides the boundary case, because seventeen hexes of separation rounds to two low-altitude hexes and sixteen rounds to one.

      Parameters:
      hexDistance - distance in hexes of this venue's map, negative values treated as zero
      Returns:
      the equivalent distance in low-altitude hexes