Enum Direction

    • Enum Constant Detail

      • DOWN

        public static final Direction DOWN
        Direction down (south/bottom).
      • RIGHT

        public static final Direction RIGHT
        Direction right (east).
      • LEFT

        public static final Direction LEFT
        Direction left (west).
      • UP

        public static final Direction UP
        Direction up (north/top).
      • DOWN_RIGHT

        public static final Direction DOWN_RIGHT
        Direction down-right (south-east).
      • DOWN_LEFT

        public static final Direction DOWN_LEFT
        Direction down-left (south-west).
      • UP_RIGHT

        public static final Direction UP_RIGHT
        Direction up-right (north-east).
      • UP_LEFT

        public static final Direction UP_LEFT
        Direction up-left (north-west).
    • Method Detail

      • values

        public static Direction[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Direction c : Direction.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Direction valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        NullPointerException - if the argument is null
      • getValue

        public String getValue()
        Returns:
        the shortcut representation.
      • isRight

        public boolean isRight()
        Returns:
        true if pointing right (RIGHT, DOWN_RIGHT, or UP_RIGHT), false otherwise.
      • isLeft

        public boolean isLeft()
        Returns:
        true if pointing left (LEFT, DOWN_LEFT, or UP_LEFT), false otherwise.
      • isDown

        public boolean isDown()
        Returns:
        true if pointing down (DOWN, DOWN_RIGHT, or DOWN_LEFT), false otherwise.
      • isUp

        public boolean isUp()
        Returns:
        true if pointing up (UP, UP_RIGHT, or UP_LEFT), false otherwise.