This repository has been archived by the owner on May 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CDoor.h
93 lines (73 loc) · 2.07 KB
/
CDoor.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//Header CDoor
// @Author = Jan van Dick
#ifndef CDOOR_H
#define CDOOR_H
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
//Forward declarations:
class CRoom;
class CDoor
{
private:
char* m_chName; //Name of the Door (can be changed during the game)
int m_localID; //(local ID of the Door (existing in the door-list of a room)
int m_ID; //ID clearly identifing this room
CRoom* m_linkedRoom; //Room the door is leading to
int m_curDescription; //Marks current discription
std::vector<std::string> m_sDescriptions; //String array of all descriptions
//of the room this door is leading to
void(CDoor::*m_callDescription)(); //Points on a function to call description of the next
//room and gives various other possibilities
public:
//Constructor
CDoor(char* chName, CRoom* linkedRoom, int localID, int ID,
std::vector<std::string> sDescription, void(CDoor::*callDescription)());
//Getter
//Get name of the door
char* getName()
{
return m_chName;
}
//Get DoorID (local ID) of the door
int getDoorID()
{
return m_localID;
}
//Get ID of the door
int getID()
{
return m_ID;
}
//Get the room the door is leading to
CRoom* getLinkedRoom()
{
return m_linkedRoom;
}
//Setter
//Set door-name
void setName(char* chName)
{
m_chName = chName;
}
//Set currentDiscription
void setCurrentDescription(int Index)
{
m_curDescription = Index;
}
//Set callDescription
void setCallDescription(void(CDoor::*callDescription)())
{
m_callDescription = callDescription;
}
//Print Description
void printDescription();
//Call "m_callDescription
void callDesc();
//Descriptions
void DescCall_Standard();
void DescCall_Increase1CurDesc();
void DescCallLeninsTomb();
};
#endif