I would rather do this ``` enum class Direction { ...
# getting-started
e
I would rather do this
Copy code
enum class Direction {
  NORTH,
  SOUTH,
  EAST,
  WEST,
  START,
  END;

  val oppositeDirection: Direction get() = when (this) {
    NORTH -> SOUTH
    SOUTH -> NORTH
    EAST -> WEST
    WEST -> EAST
    START -> END
    END -> START
  }
}
👍 1