Enum Class OffBoardDirection

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

public enum OffBoardDirection extends Enum<OffBoardDirection>
This interface represents Off-Board Directions
  • Enum Constant Details

  • Method Details

    • values

      public static OffBoardDirection[] 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 OffBoardDirection 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
    • getValue

      public int getValue()
    • getDirection

      public static OffBoardDirection getDirection(int value)
    • translateBoardStart

      public static OffBoardDirection translateBoardStart(int value)
      Translate a "START_X" constant from Board.java into one of these values if possible.
    • getOpposite

      public static OffBoardDirection getOpposite(OffBoardDirection value)
      Gets the opposite direction of the given direction.
    • translateBoardStart

      @Deprecated(since="0.51.0", forRemoval=true) public int translateBoardStart()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Converts this OffBoardDirection to a Board.START_X constant.
      Returns:
      The corresponding Board.START_X value, or Board.START_ANY for NONE
    • fromBoardStart

      public static OffBoardDirection fromBoardStart(int boardStart)
      Creates an OffBoardDirection from a Board.START_X constant. This is the inverse of translateBoardStart().
      Parameters:
      boardStart - A Board.START_X constant
      Returns:
      The corresponding OffBoardDirection, or NONE if not recognized
    • translateStartPosition

      public static OffBoardDirection translateStartPosition(int startPos)
      Returns the OffBoardDirection associated with given the on-board deployment position as defined in IStartingPositions.