Wip: Working on Room Movement
This commit is contained in:
+15
-2
@@ -18,8 +18,8 @@ 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"}};
|
||||
static std::map<std::string, Direction> directions{{"N", N}, {"S", S}, {"E", E}, {"W", W}};
|
||||
static std::map<Direction, std::string> directionChar{{N, "N"}, {S, "S"}, {E, "E"}, {W, "W"}};
|
||||
|
||||
class Room {
|
||||
private:
|
||||
@@ -39,6 +39,19 @@ public:
|
||||
|
||||
bool ValidDirection(Direction d);
|
||||
|
||||
inline bool operator==(const Room &rhs) const {
|
||||
if (id == rhs.id) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
inline bool operator!=(const Room &rhs) const {
|
||||
if (id != rhs.id) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
~Room();
|
||||
|
||||
friend void to_json(nlohmann::json &j, const Room &r);
|
||||
|
||||
Reference in New Issue
Block a user