-
Notifications
You must be signed in to change notification settings - Fork 0
/
EscapeRoomWrapper.h
137 lines (95 loc) · 4.31 KB
/
EscapeRoomWrapper.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#ifndef ESCAPEROOMWRAPPER_H
#define ESCAPEROOMWRAPPER_H
#include <string>
#include <vector>
#include <iostream>
#include "Enigma.h"
#include "EscapeRoom.h"
#include "Exceptions.h"
//#include "Company.h"
namespace mtm{
namespace escaperoom {
class EscapeRoomWrapper {
EscapeRoom room;
std::vector<Enigma*> enigmas;
protected:
//virtual int getRoomType() const;
public:
//TODO is it possible to move to protected
int getRoomLevel() const;
// Constructs a new Escape Room with the specified data.
//
// @param name : the name of the escape room.
// @param escapeTime : the maximal escape time allowed in the room.
// @param level : the level of the escape room.
// @param maxParticipants: the maximal participants allowed in the room.
// The rest of the room's data is initialized as described in the exercise sheet.
// @throws EscapeRoomMemoryProblemException in case of creation failure.
EscapeRoomWrapper(char* name, const int& escapeTime, const int& level, const int& maxParticipants);
// Constructs a new Escape Room with the specified data.
//
// @param name : the name of the enigma.
// @param level : the level of the escape room.
// The rest of the room's data is initialized as described in the exercise sheet.
// @throws EscapeRoomMemoryProblemException in case of creation failure.
EscapeRoomWrapper(char* name, const int& level);
//copy constructor
//
//@param room : the room to be copied.
//@throws EscapeRoomMemoryProblemException in case of creation failure.
EscapeRoomWrapper(const EscapeRoomWrapper& room);
//EscapeRoomWrapper(EscapeRoomWrapper& room);
//assignment operator
//
//@param room : the room to be assigned.
EscapeRoomWrapper& operator=(const EscapeRoomWrapper& room);
//EscapeRoomWrapper& operator=(EscapeRoomWrapper& room);
// Comparison operators for Escape Rooms. rooms are compared as described in
// the exercise sheet.
//
// @param room : the right-hand side operand.
bool operator==(const EscapeRoomWrapper& room) const;
bool operator!=(const EscapeRoomWrapper& room) const;
bool operator<(const EscapeRoomWrapper& room) const;
bool operator>(const EscapeRoomWrapper& room) const;
bool operator<=(const EscapeRoomWrapper& room) const = delete;
bool operator>=(const EscapeRoomWrapper& room) const = delete;
// return the level of the Escape Room.
//
int level() const;
// the method changes the rate according to the rate given.
//
// @param newRate : the new rate accepted to the room.
//@throws EscapeRoomIllegalRateException in case of illegal rate parameter.
void rate(const int& newRate) const;
// Destructor for EscapeRoomWrapper
virtual ~EscapeRoomWrapper();
// Prints the data of the Room in the following format:
//
// "<name> (<maxTime>/<level>/<maxParticipants>)"
//
// @param output : the output stream to which the data is printed.
// @param room : the room whose data is printed.
friend std::ostream& operator<<(std::ostream& output, const EscapeRoomWrapper& room);
//Function returns the name of the EscapeRoom.
//
std::string getName() const;
//Function returns the rate of the EscapeRoom.
//
double getRate() const;
//Function returns the maximum escape time of the EscapeRoom.
//
int getMaxTime() const;
//Function returns the number of participants allowed in the EscapeRoom.
//
int getMaxParticipants() const;
void addEnigma(const Enigma& enigma);
void removeEnigma(const Enigma& enigma);
Enigma getHardestEnigma();
std::vector<Enigma*> getAllEnigmas();
virtual void print(std::ostream& output) const;
};
std::ostream& operator<<(std::ostream& output, const EscapeRoomWrapper& room);
} // end of namespace eascaperoom
} // end of namespace mtm
#endif //ESCAPEROOMWRAPPER_H