diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-10-31 08:52:27 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-10-31 16:57:54 +0100 |
commit | 263ca91b08100ae09dce275d4629413c63f343c9 (patch) | |
tree | 165acf19905df3596277a6de5a522a045daa2ada /crawl-ref/source/act-iter.h | |
parent | a57962fa1975ecc27863c2f847fa2a1c4484f7fa (diff) | |
download | crawl-ref-263ca91b08100ae09dce275d4629413c63f343c9.tar.gz crawl-ref-263ca91b08100ae09dce275d4629413c63f343c9.zip |
Rewrite monster_iterator.
It degenerated to a simple loop over menv, hardly worth any syntactic sugar.
I kept it for now, though.
Diffstat (limited to 'crawl-ref/source/act-iter.h')
-rw-r--r-- | crawl-ref/source/act-iter.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crawl-ref/source/act-iter.h b/crawl-ref/source/act-iter.h index 58db3eab7c..a9a69b7405 100644 --- a/crawl-ref/source/act-iter.h +++ b/crawl-ref/source/act-iter.h @@ -50,4 +50,20 @@ protected: void advance(); }; +class monster_iterator +{ +public: + monster_iterator(); + + operator bool() const; + monster* operator*() const; + monster* operator->() const; + monster_iterator& operator++(); + monster_iterator operator++(int); + +protected: + int i; + void advance(); +}; + #endif |