Wip: Working on Room Movement

This commit is contained in:
Timothy O'Barr
2026-08-21 15:52:12 -05:00
parent 66fd2b0951
commit ae46fdf51f
6 changed files with 83 additions and 26 deletions
+17 -4
View File
@@ -44,19 +44,21 @@ std::vector<std::string> CommandParser::Noun(std::stringstream &sentences) {
return nouns;
}
int CommandParser::Parse() {
std::string cmd;
std::string word;
std::string noun;
std::string noun = "";
std::vector<std::string> verbs;
std::vector<std::string> nouns;
FUNCTION toRun;
printf("Please Enter a command \n");
printf("> ");
getline(std::cin, cmd);
std::cin.clear();
cmd[0] = toupper(cmd[0]);
std::stringstream c(cmd);
@@ -69,8 +71,19 @@ int CommandParser::Parse() {
printf("Sorry kid, can't understand ya! \n");
break;
}
commands[verb]("");
toRun = commands[verb];
}
if (toRun) {
toRun(noun);
}
cmd.clear();
word.clear();
verbs.clear();
nouns.clear();
c.clear();
toRun = nullptr;
return 0;
}