package se.urmo.game.util;

public enum Direction {
    RIGHT(1, 0, 0),
    LEFT(-1, 0  , 180),
    DOWN(0, 1, 90),
    UP(0, -1, 270),
    NONE(0, 0, 0);

    public final int dx;
    public final int dy;
    public final int angel;

    Direction(int dx, int dy, int angel) {
        this.dx = dx;
        this.dy = dy;
        this.angel = angel;
    }

    public Direction opposite() {
        switch (this) {
            case RIGHT: return LEFT;
            case LEFT:  return RIGHT;
            case DOWN:  return UP;
            case UP:    return DOWN;
            default:    return NONE;
        }
    }
}
