/**********************************
 * Assignment 5: Pacman
 * Date: 5/5/2006
 *
 * Jenna Holloway: jh382, 563324
 * Benji Shultz: bas67, 1786511
 **********************************/
package game.actor;

/**
 * Enum to represent the direction an Actor is moving in
 * @author Alec Berntson
 *
 */
public enum MovementDirection {
   NORTH, SOUTH, EAST, WEST, NONE;

   public static boolean isOpposite(MovementDirection d1, MovementDirection d2) {
      return (d1 == NORTH && d2 == SOUTH)
      || (d1 == SOUTH && d2 == NORTH)
      || (d1 == EAST && d2 == WEST)
      || (d1 == WEST && d2 == EAST);
   }

   public static MovementDirection getOpposite(MovementDirection d) {
      if (d == NORTH) return SOUTH;
      if (d == SOUTH) return NORTH;
      if (d == EAST) return WEST;
      if (d == WEST) return EAST;
      return NONE;
   }
}
