-
Notifications
You must be signed in to change notification settings - Fork 1
/
Space.hpp
47 lines (41 loc) · 1.22 KB
/
Space.hpp
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
/*********************************************************************
* Space Class
* This is an abstract class which contains 4 pointers to Space to keep
* track of the directions within the derived Spaces (or rooms). It also
* contains a data member called roomName which allows the naming of a
* room. It contains two bool variables called itemObtained and
* wasRoomSearched, which keep track of whether the room was searched
* or the item was obtained from the room. The class contains various
* functions.
*********************************************************************/
#ifndef SPACE_HPP
#define SPACE_HPP
#include <iostream>
#include <string>
#include <iomanip>
class Space
{
protected:
Space *up;
Space *down;
Space *right;
Space *left;
std::string roomName;
bool itemObtained;
bool wasRoomSearched;
public:
Space(std::string);
virtual void settingInfo() = 0;
virtual int roomMenu() = 0;
std::string getRoomName();
Space *getUp();
Space *getDown();
Space *getRight();
Space *getLeft();
void setNextRoom(char, Space*);
void setWasRoomSearched();
int getWasRoomSearched();
void setWasItemObtained();
int getWasItemObtained();
};
#endif