Enum Class DIRECTION

java.lang.Object
java.lang.Enum<DIRECTION>
com.JayPi4c.RobbiSimulator.model.DIRECTION
All Implemented Interfaces:
Serializable, Comparable<DIRECTION>, Constable

public enum DIRECTION extends Enum<DIRECTION>
Enumeration to hold all cardinal-points to store robbis current facing.
Author:
Jonas Pohl
  • Enum Constant Details

    • NORTH

      public static final DIRECTION NORTH
      Direction if robbi is looking up.
    • WEST

      public static final DIRECTION WEST
      Direction if robbi is looking left.
    • SOUTH

      public static final DIRECTION SOUTH
      Direction if robbi is looking down.
    • EAST

      public static final DIRECTION EAST
      Direction if robbi is looking right.
  • Method Details

    • values

      public static DIRECTION[] 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 DIRECTION 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
    • next

      public DIRECTION next()
      moves through the direction counter-clockwise
      Returns:
      the next direction after a counter-clockwise 90 degrees turn.
    • previous

      public DIRECTION previous()
      Moves through the direction clockwise.
      Returns:
      the next direction after a clockwise 90 degrees turn.