summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/coordit.h
diff options
context:
space:
mode:
authorinfiniplex <infiniplex@hotmail.com>2013-04-24 15:53:13 -0600
committerPete Hurst <pete@streamuniverse.tv>2013-04-26 04:35:51 +0100
commit2bf6e517d8fc587274b02438e8e99f89b1c02c26 (patch)
tree1ef96e29c8e74e42023d7cdf63e7f4b11cbb56eb /crawl-ref/source/coordit.h
parent6b2219cf93f0c96be5923cf33475389937050397 (diff)
downloadcrawl-ref-2bf6e517d8fc587274b02438e8e99f89b1c02c26.tar.gz
crawl-ref-2bf6e517d8fc587274b02438e8e99f89b1c02c26.zip
Added dgn_connect_adjacent_rooms LUA function
Diffstat (limited to 'crawl-ref/source/coordit.h')
-rw-r--r--crawl-ref/source/coordit.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/crawl-ref/source/coordit.h b/crawl-ref/source/coordit.h
index 74ae22d878..9c9695882a 100644
--- a/crawl-ref/source/coordit.h
+++ b/crawl-ref/source/coordit.h
@@ -18,6 +18,35 @@ private:
coord_def current, topleft, bottomright;
};
+/**
+ * @class random_rectangle_iterator
+ * Iterator over coordinates in a rectangular region in a
+ * random order. This interator does not favour any given
+ * direction, but is slower than rectangle_iterator.
+ *
+ * When this iterator has returned all elements, it will just
+ * return the top left corner forever.
+ */
+class random_rectangle_iterator : public iterator<forward_iterator_tag,
+ coord_def>
+{
+public:
+ random_rectangle_iterator(const coord_def& corner1,
+ const coord_def& corner2);
+ explicit random_rectangle_iterator(int x_border_dist,
+ int y_border_dist = -1);
+ operator bool() const PURE;
+ coord_def operator *() const PURE;
+ const coord_def* operator->() const PURE;
+
+ void operator ++ ();
+ void operator ++ (int);
+private:
+ coord_def top_left;
+ vector<coord_def> remaining;
+ int current;
+};
+
class circle_iterator
{
const circle_def &circle;