Wip: Working on room movements, player location in room, and data storage
This commit is contained in:
+17
-1
@@ -4,6 +4,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "json.hpp"
|
||||
#include "player.h"
|
||||
#include "scenery.h"
|
||||
|
||||
using json = nlohmann::json;
|
||||
@@ -26,14 +27,17 @@ private:
|
||||
int id;
|
||||
std::string name;
|
||||
std::string description;
|
||||
Player player;
|
||||
std::vector<Exit> exits;
|
||||
std::vector<Scenery> scenery;
|
||||
std::vector<Scenery> scenery; /// ToDo: Replace with entity component system
|
||||
|
||||
public:
|
||||
Room();
|
||||
Room(int i, std::string n, std::string desc, std::vector<Exit> e, std::vector<Scenery> s);
|
||||
Room(const Room &r);
|
||||
|
||||
void Enter(Player &p);
|
||||
|
||||
void PrintAvalibleExits();
|
||||
void Print() const;
|
||||
int GetID() const { return id; }
|
||||
@@ -53,8 +57,20 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
Room &operator=(Room rhs);
|
||||
|
||||
~Room();
|
||||
|
||||
friend void to_json(nlohmann::json &j, const Room &r);
|
||||
friend void from_json(const nlohmann::json &j, Room &r);
|
||||
|
||||
inline friend void swap(Room &lhs, Room &rhs) noexcept {
|
||||
using std::swap;
|
||||
swap(lhs.id, rhs.id);
|
||||
swap(lhs.name, rhs.name);
|
||||
swap(lhs.description, rhs.description);
|
||||
swap(lhs.player, rhs.player);
|
||||
swap(lhs.exits, rhs.exits);
|
||||
swap(lhs.scenery, rhs.scenery);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user