From 8a138fcc4cc3d68222c255541736fc7e27627adb Mon Sep 17 00:00:00 2001 From: lethosor Date: Sat, 15 Oct 2016 14:53:10 -0400 Subject: [PATCH] Avoid polluting global namespace in MapCache.h --- library/include/modules/MapCache.h | 6 +++--- plugins/Brushes.h | 11 +++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/library/include/modules/MapCache.h b/library/include/modules/MapCache.h index b1d411ab8..b64cc7859 100644 --- a/library/include/modules/MapCache.h +++ b/library/include/modules/MapCache.h @@ -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 blocks; }; } -#endif \ No newline at end of file +#endif diff --git a/plugins/Brushes.h b/plugins/Brushes.h index 99e9e4125..eaf4240ea 100644 --- a/plugins/Brushes.h +++ b/plugins/Brushes.h @@ -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 to_flood; @@ -198,19 +199,21 @@ public: return "flood"; } private: - void maybeFlood(DFCoord c, std::stack &to_flood, MapExtras::MapCache &mc) { + void maybeFlood(DFHack::DFCoord c, std::stack &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 & 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)