Fixed several issues with Parser and enabled room navigation
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#include "CommandParser.h"
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
@@ -24,10 +23,6 @@ std::vector<std::string> CommandParser::Verb(std::stringstream &sentences) {
|
||||
}
|
||||
}
|
||||
|
||||
if (verbs.empty()) {
|
||||
CommandUnrecognized();
|
||||
}
|
||||
|
||||
return verbs;
|
||||
}
|
||||
|
||||
@@ -68,7 +63,7 @@ int CommandParser::Parse() {
|
||||
for (const auto &verb: verbs) {
|
||||
|
||||
if (!commands[verb]) {
|
||||
printf("Sorry kid, can't understand ya! \n");
|
||||
CommandUnrecognized();
|
||||
break;
|
||||
}
|
||||
toRun = commands[verb];
|
||||
|
||||
Reference in New Issue
Block a user