00001 /* 00002 * Provide a way to iterator over all actors, 00003 * subject to a few common restrictions. 00004 */ 00005 00006 #ifndef ACT_ITER_H 00007 #define ACT_ITER_H 00008 00009 #include "mon-iter.h" 00010 00011 class actor_iterator 00012 { 00013 public: 00014 actor_iterator(); 00015 actor_iterator(const circle_def* circle_); 00016 actor_iterator(const los_base* los_); 00017 actor_iterator(const actor* act_); 00018 00019 operator bool() const; 00020 actor* operator*() const; 00021 actor* operator->() const; 00022 actor_iterator& operator++(); 00023 actor_iterator operator++(int); 00024 00025 protected: 00026 restr_type restr; 00027 const circle_def* circle; 00028 const los_base* los; 00029 const actor* act; 00030 bool did_you; 00031 monster_iterator mi; 00032 00033 bool valid(const actor* a) const; 00034 void raw_advance(); 00035 void advance(bool may_stay=false); 00036 }; 00037 00038 #endif