Enum Class Direction

java.lang.Object
java.lang.Enum<Direction>
dev.despical.mazeengine.core.Direction
All Implemented Interfaces:
Serializable, Comparable<Direction>, Constable

public enum Direction extends Enum<Direction>
Defines the cardinal connections used by the logical maze graph.

Each direction has an X/Z step and one graph-mask bit. Adjacent cells store reciprocal bits, so opening east from one cell also opens west from its neighbor. The enum order supplies both the bit index and opposite lookup.

The generator, graph validation, route search, and block plan share these directions. Entrance and exit portals use a side to describe an external opening rather than adding another internal edge to the cell graph.

  • Enum Constant Details

  • Field Details

    • dx

      public final int dx
    • dz

      public final int dz
  • 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
    • opposite

      public Direction opposite()
    • bit

      public int bit()