forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mapdata.cpp
47 lines (41 loc) · 800 Bytes
/
mapdata.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
#include "mapdata.h"
#include <ostream>
std::ostream & operator<<(std::ostream & out, const submap * sm)
{
out << "submap(";
if( !sm )
{
out << "NULL)";
return out;
}
out << "\n\tter:";
for(int x = 0; x < SEEX; ++x)
{
out << "\n\t" << x << ": ";
for(int y = 0; y < SEEY; ++y)
out << sm->ter[x][y] << ", ";
}
out << "\n\titm:";
for(int x = 0; x < SEEX; ++x)
{
for(int y = 0; y < SEEY; ++y)
{
if( !sm->itm[x][y].empty() )
{
for( std::vector<item>::const_iterator it = sm->itm[x][y].begin(),
end = sm->itm[x][y].end(); it != end; ++it )
{
out << "\n\t("<<x<<","<<y<<") ";
out << *it << ", ";
}
}
}
}
out << "\n\t)";
return out;
}
std::ostream & operator<<(std::ostream & out, const submap & sm)
{
out << (&sm);
return out;
}