diff options
author | Adam Borowski <kilobyte@angband.pl> | 2011-09-08 20:44:40 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2011-09-08 20:59:51 +0200 |
commit | 4481293100e20e66204266c41607cd36617cb0ce (patch) | |
tree | 9d38d4269a9f2a55296082cbd74ff58f454c07c0 /crawl-ref/source/travel.h | |
parent | 7d749da6cfc0101b0bba0484cc413cf873285867 (diff) | |
download | crawl-ref-4481293100e20e66204266c41607cd36617cb0ce.tar.gz crawl-ref-4481293100e20e66204266c41607cd36617cb0ce.zip |
An iterator for going through all level_id values.
It's a travesty something like this is even needed. Really, all the
level_type nonsense and portal levels inaccessible except for parsing their
description should be regular branches.
For now, here's a crutch.
Diffstat (limited to 'crawl-ref/source/travel.h')
-rw-r--r-- | crawl-ref/source/travel.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h index 69f10f51bc..dc67372bc2 100644 --- a/crawl-ref/source/travel.h +++ b/crawl-ref/source/travel.h @@ -621,4 +621,14 @@ int click_travel(const coord_def &gc, bool force); bool check_for_interesting_features(); void clear_level_target(); +class level_id_iterator : public std::iterator<std::forward_iterator_tag, level_id> +{ +public: + level_id_iterator(); + operator bool() const; + level_id operator *() const; + void operator++(); +private: + level_id cur; +}; #endif // TRAVEL_H |