Inital Commit
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "json.hpp"
|
||||
#include "object.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);
|
||||
};
|
||||
|
||||
class Room {
|
||||
private:
|
||||
int id;
|
||||
std::string name;
|
||||
std::string description;
|
||||
std::vector<Exit> exits;
|
||||
std::vector<std::unique_ptr<Object>> objects;
|
||||
|
||||
public:
|
||||
Room();
|
||||
Room(int id, std::string name, std::string desc, std::vector<Exit> e);
|
||||
Room(const Room &r);
|
||||
|
||||
int AvalibleExits() { return exits.size(); }
|
||||
void Print() const;
|
||||
|
||||
~Room();
|
||||
|
||||
friend void to_json(nlohmann::json &j, const Room &r);
|
||||
friend void from_json(const nlohmann::json &j, Room &r);
|
||||
};
|
||||
Reference in New Issue
Block a user