Petr Mrázek 2012-04-16 22:37:07 +02:00
commit 7946cafc86
4 changed files with 582 additions and 386 deletions

@ -120,7 +120,7 @@ struct Core::Private
}
};
void cheap_tokenise(string const& input, vector<string> &output)
void Core::cheap_tokenise(string const& input, vector<string> &output)
{
string *cur = NULL;
@ -179,7 +179,7 @@ void fHKthread(void * iodata)
color_ostream_proxy out(core->getConsole());
vector <string> args;
cheap_tokenise(stuff, args);
Core::cheap_tokenise(stuff, args);
if (args.empty()) {
out.printerr("Empty hotkey command.\n");
continue;
@ -220,7 +220,7 @@ static void runInteractiveCommand(Core *core, PluginManager *plug_mgr, int &clue
{
// cut the input into parts
vector <string> parts;
cheap_tokenise(command,parts);
Core::cheap_tokenise(command,parts);
if(parts.size() == 0)
{
clueless_counter ++;

@ -137,6 +137,8 @@ namespace DFHack
PluginManager *getPluginManager() { return plug_mgr; }
static void cheap_tokenise(std::string const& input, std::vector<std::string> &output);
private:
DFHack::Console con;

@ -6,6 +6,9 @@ class Brush
public:
virtual ~Brush(){};
virtual coord_vec points(MapExtras::MapCache & mc,DFHack::DFCoord start) = 0;
virtual std::string str() const {
return "unknown";
}
};
/**
* generic 3D rectangle brush. you can specify the dimensions of
@ -56,6 +59,13 @@ public:
return v;
};
~RectangleBrush(){};
std::string str() const {
if (x_ == 1 && y_ == 1 && z_ == 1) {
return "point";
} else {
return "rectangle";
}
}
private:
int x_, y_, z_;
int cx_, cy_, cz_;
@ -89,6 +99,9 @@ public:
}
return v;
};
std::string str() const {
return "block";
}
};
/**
@ -117,6 +130,9 @@ public:
}
return v;
};
std::string str() const {
return "column";
}
};
/**
@ -168,6 +184,9 @@ public:
return v;
}
std::string str() const {
return "flood";
}
private:
void maybeFlood(DFCoord c, std::stack<DFCoord> &to_flood, MapExtras::MapCache &mc) {
if (mc.testCoord(c)) {
@ -176,3 +195,7 @@ private:
}
Core *c_;
};
std::ostream &operator<<(std::ostream &stream, const Brush& brush) {
stream << brush.str();
}

File diff suppressed because it is too large Load Diff