Added several commands

This commit is contained in:
Timothy O'Barr
2026-08-21 08:02:22 -05:00
parent 9b72d1588e
commit 66fd2b0951
7 changed files with 101 additions and 47 deletions
+6 -4
View File
@@ -18,6 +18,9 @@ struct Exit {
friend void to_json(json &j, const Exit &e);
};
static std::map<char *, Direction> directions{{"N", N}, {"S", S}, {"E", E}, {"W", W}};
static std::map<Direction, const char *> directionChar{{N, "N"}, {S, "S"}, {E, "E"}, {W, "W"}};
class Room {
private:
int id;
@@ -30,15 +33,14 @@ public:
Room(int id, std::string name, std::string desc, std::vector<Exit> e);
Room(const Room &r);
int AvalibleExits() const { return exits.size(); }
void PrintAvalibleExits();
void Print() const;
int GetID() const { return id; }
bool ValidDirection(Direction d);
~Room();
friend void to_json(nlohmann::json &j, const Room &r);
friend void from_json(const nlohmann::json &j, Room &r);
};
static int Move(std::string c);