Enum Class Facing

java.lang.Object
java.lang.Enum<Facing>
megamek.common.Facing
All Implemented Interfaces:
Serializable, Comparable<Facing>, Constable

public enum Facing extends Enum<Facing>
Enumeration of all 6 possible facings. It provides methods for translation from old integer constants. Utility methods for turning left, right and getting opposite direction are also provided.
  • Enum Constant Details

    • N

      public static final Facing N
    • NE

      public static final Facing NE
    • SE

      public static final Facing SE
    • S

      public static final Facing S
    • SW

      public static final Facing SW
    • NW

      public static final Facing NW
    • NONE

      public static final Facing NONE
  • Method Details

    • values

      public static Facing[] 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 Facing 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
    • valueOfInt

      public static Facing valueOfInt(int i)
      Method provided for backward compatibility with old integer constants.
      Parameters:
      i - Integer constant. must be non-negative
    • getIntValue

      public int getIntValue()
      Method provided for backward compatibility with old integer constants.
    • getAngle

      public int getAngle()
      Returns:
      Facing in degrees, e.g. N.getAngle() returns 0, NE.getAngle() returns 30 and S.getAngle() returns 180.
    • getOpposite

      public Facing getOpposite()
      Returns:
      Facing in the opposite direction e.g. N.getOpposite returns S
    • getNextClockwise

      @Deprecated(since="0.51.0", forRemoval=true) public Facing getNextClockwise()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      the next facing in clockwise direction
    • getNextCounterClockwise

      @Deprecated(since="0.51.0", forRemoval=true) public Facing getNextCounterClockwise()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      the next facing in counterclockwise direction