-
Notifications
You must be signed in to change notification settings - Fork 11
/
b.cpp
66 lines (61 loc) · 1.18 KB
/
b.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
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
#include "stdafx.h"
#include "b.h"
#include "room.h"
#include "rooms.h"
namespace
{
const Bits bittys[] =
{
rlightbit,
rairbit,
rwaterbit,
rsacredbit,
rfillbit,
rmungbit,
rbuckbit,
rhousebit,
rendgame,
};
const char *desc[] =
{
"Lighted",
"Mid-air",
"Watery",
"Robber-proof",
"Water-source",
"Destroyed",
"Bucket",
"part of the House",
"part of the End Game",
};
static_assert(sizeof(bittys) / sizeof(bittys[0]) == sizeof(desc) / sizeof(desc[0]), "array sizes do not match");
}
bool bit_info(RoomP r)
{
bool bb = false;
if (r->rval() != 0)
{
princ("Room is valued at ");
princ(r->rval());
bb = true;
}
for (size_t i = 0; i < sizeof(bittys) / sizeof(bittys[0]); ++i)
{
if (rtrnn(r, bittys[i]))
{
if (bb)
{
princ(", ");
}
else
{
princ("Room is ");
}
bb = true;
princ(desc[i]);
}
}
if (bb)
princ(".\n\n");
return bb;
}