#include "input.h"

#include "constants.h"

const char *COMMANDS[] = {
        "no", "so", "ea", "we", "ne", "nw", "se", "sw"
};
const int COMMANDS_CNT = 8;

game_command get_direction(std::string &str) {
        for (int i = 0; i < COMMANDS_CNT; ++i)
                if (str == COMMANDS[i])
                        return static_cast<game_command>(i);

        return GAME_COMMAND_PANIC;
}
