Enum Class RelativeSide

java.lang.Object
java.lang.Enum<RelativeSide>
fr.robie.machineengine.api.world.RelativeSide
All Implemented Interfaces:
Serializable, Comparable<RelativeSide>, Constable

public enum RelativeSide extends Enum<RelativeSide>
A face relative to a machine's facing (ARCHITECTURE.md ยง11.2). The front is the face the machine looks towards; left and right are as seen when standing behind the machine, looking the same way.
  • Enum Constant Details

  • Method Details

    • values

      public static RelativeSide[] 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 RelativeSide 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
    • toAbsolute

      @NotNull public @NotNull Direction toAbsolute(@NotNull @NotNull Direction facing)
      Parameters:
      facing - the machine's facing. Facing up or down, the machine is a north-facing one turned over its west-east axis: its top then faces south (up) or north (down), its left and right stay west and east.
    • fromAbsolute

      @Nullable public static @Nullable RelativeSide fromAbsolute(@NotNull @NotNull Direction facing, @NotNull @NotNull Direction absolute)
      Returns:
      the relative side that absolute is for a machine facing facing