moved get_direction from *_input.cc to input.h
This commit is contained in:
@ -5,17 +5,6 @@
|
||||
console_input::console_input(std::istream &cin):
|
||||
in{cin} {}
|
||||
|
||||
inline game_command get_direction(std::string &str, const char *COMMANDS[],
|
||||
const int COMMANDS_CNT) {
|
||||
for (int i = 0; i < COMMANDS_CNT; ++i)
|
||||
if (str == COMMANDS[i] &&
|
||||
i >= game_command::move_north &&
|
||||
i <= game_command::move_southeast)
|
||||
return (game_command)i;
|
||||
|
||||
return game_command_panic;
|
||||
}
|
||||
|
||||
game_command console_input::get_command() {
|
||||
const char *COMMANDS[] = {
|
||||
"q", "no", "so", "ea", "we", "ne", "nw", "se", "sw", "u", "a"
|
||||
|
Reference in New Issue
Block a user