-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinside.cpp
38 lines (34 loc) · 941 Bytes
/
inside.cpp
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
#include "inside.h"
namespace da_game {
/**
* Constructs a new empty inside environment with no exits.
*/
Inside::Inside() {
}
/**
* Constructs a new inside environment.
*
* @param east The east exit
* @param west The west exit
* @param north The north exit
* @param south The south exit
*/
Inside::Inside(Exit * east, Exit * west, Exit * north, Exit * south) {
if (east != 0) {
std::pair<std::string, Exit *> e("east", east);
exits.insert(e);
}
if (west != 0) {
std::pair<std::string, Exit *> w("west", west);
exits.insert(w);
}
if (north != 0) {
std::pair<std::string, Exit *> n("north", north);
exits.insert(n);
}
if (south != 0) {
std::pair<std::string, Exit *> s("south", south);
exits.insert(s);
}
}
}