summaryrefslogtreecommitdiff
path: root/plugins/Brushes.h
diff options
context:
space:
mode:
authorJared Adams2012-04-15 08:40:19 -0600
committerJared Adams2012-04-15 08:40:19 -0600
commitf3c7a685f5b6d84bff6193ad289df3cda634a4ee (patch)
treea0b45bbac4b659f0e8f46c51fea67915387b0399 /plugins/Brushes.h
parentc69af6ab9eff10fc59f68d462656caa2dacd266c (diff)
downloaddfhack-f3c7a685f5b6d84bff6193ad289df3cda634a4ee.tar.gz
dfhack-f3c7a685f5b6d84bff6193ad289df3cda634a4ee.tar.bz2
dfhack-f3c7a685f5b6d84bff6193ad289df3cda634a4ee.tar.xz
Make tiletypes more useful
* Paint, filter, and brush state is now saved between calls. * Added 'all' paint option to set material, shape, special, and variant at the same time. * Added tiletypes-here (like liquids here, except is uses the saved brush settings) * Added tiletypes-here-point (like liquids here, always only the tile under the cursor) * Added tiletypes-command: runs tiletypes commands seperated by ';' tokens (affects saved state) * Make the internal workings match liquids a bit more * Give brush objects a descriptor string * Make Core::cheap_tokenise available
Diffstat (limited to 'plugins/Brushes.h')
-rw-r--r--plugins/Brushes.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/plugins/Brushes.h b/plugins/Brushes.h
index 73c3a05a..97ddc44c 100644
--- a/plugins/Brushes.h
+++ b/plugins/Brushes.h
@@ -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();
+}