Avoid polluting global namespace in MapCache.h

develop
lethosor 2016-10-15 14:53:10 -04:00
parent 7f7102f90c
commit 8a138fcc4c
2 changed files with 10 additions and 7 deletions

@ -38,8 +38,6 @@ distribution.
#include "df/item.h"
#include "df/inclusion_type.h"
using namespace DFHack;
namespace df {
struct world_region_details;
}
@ -47,6 +45,8 @@ namespace df {
namespace MapExtras
{
using namespace DFHack;
class DFHACK_EXPORT MapCache;
class Block;
@ -626,4 +626,4 @@ private:
std::map<DFCoord, Block *> blocks;
};
}
#endif
#endif

@ -152,10 +152,11 @@ public:
class FloodBrush : public Brush
{
public:
FloodBrush(Core *c){c_ = c;};
FloodBrush(DFHack::Core *c){c_ = c;};
~FloodBrush(){};
coord_vec points(MapExtras::MapCache & mc, DFHack::DFCoord start)
{
using namespace DFHack;
coord_vec v;
std::stack<DFCoord> to_flood;
@ -198,19 +199,21 @@ public:
return "flood";
}
private:
void maybeFlood(DFCoord c, std::stack<DFCoord> &to_flood, MapExtras::MapCache &mc) {
void maybeFlood(DFHack::DFCoord c, std::stack<DFHack::DFCoord> &to_flood,
MapExtras::MapCache &mc) {
if (mc.testCoord(c)) {
to_flood.push(c);
}
}
Core *c_;
DFHack::Core *c_;
};
command_result parseRectangle(color_ostream & out,
DFHack::command_result parseRectangle(DFHack::color_ostream & out,
vector<string> & input, int start, int end,
int & width, int & height, int & zLevels,
bool hasConsole = true)
{
using namespace DFHack;
int newWidth = 0, newHeight = 0, newZLevels = 0;
if (end > start + 1)