title: Enum of directions with opposites
body: <p>I'm currently working on a Dungeon game project which is composed of multiples rooms connected to each other.</p>
  
  <p>Depending on the room you're in you can go to rooms next to yours by picking directions (<code>North</code>, <code>South</code>, <code>East</code>, <code>West</code>). </p>
  
  <p>I've represented the directions with an <code>Enum</code> class and I'm looking for a way to implements that <code>North</code> is the opposite of <code>South</code>, <code>East</code> for <code>West</code> (and so on ...) for the sake of creating the layout of all the rooms in the final form of the game.</p>
  
  <p>Here is my <code>Enum</code> class : </p>
  
  <pre><code>public enum Direction {
      NORTH,
      EAST,
      SOUTH,
      WEST;
  
      public Direction getOppositeDirection() {
          return Direction.values()[(this.ordinal()+2)%4];
      }
  
  }
  </code></pre>
  
  <p>The problem is that currently the method is not very safe, any change in the order of declarations in the direction will break the method, any suggestions on how to do this in a better way?</p>