#pragma once #include #include #include #include #include "json.hpp" #include "scenery.h" using json = nlohmann::json; enum Direction { N, S, E, W }; struct Exit { int exitID; Direction dir; bool isLocked; friend void from_json(const json &j, Exit &e); friend void to_json(json &j, const Exit &e); }; static std::map directions{{"N", N}, {"S", S}, {"E", E}, {"W", W}}; static std::map directionChar{{N, "N"}, {S, "S"}, {E, "E"}, {W, "W"}}; class Room { private: int id; std::string name; std::string description; std::vector exits; std::vector scenery; public: Room(); Room(int id, std::string name, std::string desc, std::vector e, std::vector s); Room(const Room &r); void PrintAvalibleExits(); void Print() const; int GetID() const { return id; } 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); friend void from_json(const nlohmann::json &j, Room &r); };