-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspace.hpp
53 lines (39 loc) · 1.29 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
48
49
50
51
52
53
/*******************************************************************************
** Author: Beth Myre
** Date: 3/19/19
** Description: This is the header file for the Space class, which is the parent
* class of all of the other space-derived classes. It is a pure virtual class.
*******************************************************************************/
#ifndef SPACE_HPP
#define SPACE_HPP
#include <string>
#include "bag.hpp"
class Space {
protected:
//Pointers to adjacent spaces
Space * top;
Space * right;
Space * left;
Space * bottom;
//Pointers to the container holding the things Cat Lady collects during the game.
Bag * theBag;
//Different things happen based on whether you've already been in a particular space.
bool hereBefore;
//Some spaces start out with a cat in them (which needs to be rescued).
bool catHere;
public:
Space(Bag *);
virtual ~Space();
Space * getTop();
Space * getRight();
Space * getLeft();
Space * getBottom();
//These are only used during board set-up.
void setTop(Space *);
void setRight(Space *);
void setLeft(Space *);
void setBottom(Space *);
//Because this is a pure virtual function, the Space class can't be instantiated.
virtual int action() = 0;
};
#endif