summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/stuff.h
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-08 12:12:19 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-08 12:12:19 +0000
commit4f3558feb5639ff93e46a0795d94d638ef0c89fc (patch)
tree1b42eb5e474a7054dac54a5d50798914b3d99962 /crawl-ref/source/stuff.h
parent06b226a27e7c8f2a9ce8928311fcdfcb7c6a2f79 (diff)
downloadcrawl-ref-4f3558feb5639ff93e46a0795d94d638ef0c89fc.tar.gz
crawl-ref-4f3558feb5639ff93e46a0795d94d638ef0c89fc.zip
Added Water card. Might need some rebalancing.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4127 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/stuff.h')
-rw-r--r--crawl-ref/source/stuff.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/crawl-ref/source/stuff.h b/crawl-ref/source/stuff.h
index 42d0006c8b..d7b59c6cb4 100644
--- a/crawl-ref/source/stuff.h
+++ b/crawl-ref/source/stuff.h
@@ -48,6 +48,32 @@ int roll_dice( int num, int size );
int roll_dice( const struct dice_def &dice );
void scale_dice( dice_def &dice, int threshold = 24 );
+class radius_iterator : public std::iterator<std::bidirectional_iterator_tag,
+ coord_def>
+{
+public:
+ radius_iterator( const coord_def& center, int radius,
+ bool roguelike_metric = true,
+ bool require_los = true,
+ bool exclude_center = false );
+ bool done() const;
+ operator bool() const { return !done(); }
+ coord_def operator *() const;
+
+ const radius_iterator& operator ++ ();
+ const radius_iterator& operator -- ();
+ radius_iterator operator ++ (int);
+ radius_iterator operator -- (int);
+private:
+ void step();
+ void step_back();
+ bool on_valid_square() const;
+
+ coord_def location, center;
+ int radius;
+ bool roguelike_metric, require_los, exclude_center;
+ bool iter_done;
+};
int random2limit(int max, int limit);
int stepdown_value(int base_value, int stepping, int first_step,