Inital Commit

This commit is contained in:
Timothy O'Barr
2026-08-07 13:10:07 -05:00
commit 34f7d3f7bb
72 changed files with 31475 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#pragma once
#include <map>
#include <string>
#include <vector>
typedef int (*FUNCTION)(std::string s);
static std::vector<std::string> Verbs{"Quit", "Exit", "Go", "Move", "Look"};
static std::vector<std::string> Nouns{"Object", "Door", "North", "South", "East",
"West", "Up", "Down", "Left", "right"};
class CommandParser {
private:
// std::vector<std::string> commands;
std::map<std::string, FUNCTION> commands;
public:
CommandParser();
bool AddCommand(std::string c, FUNCTION f);
void RemoveCommand(std::string c);
std::vector<std::string> Verb(std::stringstream &sentences);
std::vector<std::string> Noun(std::stringstream &sentences);
static inline void CommandUnrecognized() { printf("I don't know how to do that.\n"); }
int Parse();
};