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/item.h"
#include "df/inclusion_type.h" #include "df/inclusion_type.h"
using namespace DFHack;
namespace df { namespace df {
struct world_region_details; struct world_region_details;
} }
@ -47,6 +45,8 @@ namespace df {
namespace MapExtras namespace MapExtras
{ {
using namespace DFHack;
class DFHACK_EXPORT MapCache; class DFHACK_EXPORT MapCache;
class Block; class Block;

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