RuneMate / Issues

Client and API Issue tracking. See README for more information.
8 stars 0 forks source link

Player#getDirection #17

Open EricBallard opened 5 years ago

EricBallard commented 5 years ago

Is your feature request related to a problem? Please describe. Get the direction the player is facing.

Describe the solution you'd like Implement this enum.

Describe alternatives you've considered None.

Additional context Add any other context or screenshots about the feature request here. `public enum Direction { NORTH, NORTH_EAST, EAST, SOUTH, SOUTH_EAST, SOUTH_WEST, WEST, NORTH_WEST;

public static Direction get(int angle) {
    switch (angle / 45) {
    case 0:
        return Direction.SOUTH;
    case 1:
        return Direction.SOUTH_WEST;
    case 2:
        return Direction.WEST;
    case 3:
        return Direction.NORTH_WEST;
    case 4:
        return Direction.NORTH;
    case 5:
        return Direction.NORTH_EAST;
    case 6:
        return Direction.EAST;
    case 7:
        return Direction.SOUTH_EAST;
    default:
        return null;
    }
}

}`

https://streamable.com/r99km