#pragma once #include #include #include typedef int (*FUNCTION)(std::string s); static std::vector Verbs{"Quit", "Exit", "Go", "Move", "Look"}; static std::vector Nouns{"Object", "Door", "North", "South", "East", "West", "Up", "Down", "Left", "right"}; class CommandParser { private: // std::vector commands; std::map commands; public: CommandParser(); bool AddCommand(std::string c, FUNCTION f); void RemoveCommand(std::string c); std::vector Verb(std::stringstream &sentences); std::vector Noun(std::stringstream &sentences); static inline void CommandUnrecognized() { printf("I don't know how to do that.\n"); } int Parse(); };