-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRoom.h
47 lines (38 loc) · 1023 Bytes
/
Room.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef ROOM_H
#define ROOM_H
#include <iostream>
#include <string>
#include <vector>
class Trump;
class Room
{
protected:
std::string name;
bool flooded;
struct Exit // exit from a space
{
Room* dest; // pointer to another space
std::string descr; // description of the path
bool open; // state open/closed of exit
Exit( Room* d1, std::string d2, bool o = true)
{
dest = d1;
descr = d2;
open = o;
}
};
std::vector<Exit> exits; // all of the exits
public:
Room();
virtual ~Room();
int choice();
virtual int interact() = 0;
std::string getName();
void setExit(Room* ,std::string , bool = true);
Room* getExit(int = 0);
void openPassages();
void openPassage(Room*);
void closePassage(Room*);
bool isFlooded();
};
#endif