diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-08-17 22:20:13 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-08-17 22:20:13 +0000 |
commit | 48b1b54aaf8c7ccc2b016158f58cf34385dd5068 (patch) | |
tree | d415f77648211e196b6f7d8f5075eaf6a1d411db /crawl-ref/source/externs.h | |
parent | 78698f0432bba7bdac30f21a17a30c1cf88ae11b (diff) | |
download | crawl-ref-48b1b54aaf8c7ccc2b016158f58cf34385dd5068.tar.gz crawl-ref-48b1b54aaf8c7ccc2b016158f58cf34385dd5068.zip |
Fixed map marker crashes.
Reduced size of Pan demon bands summoned post-Orb (cbus).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2010 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/externs.h')
-rw-r--r-- | crawl-ref/source/externs.h | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h index c1431105f0..fe553974a4 100644 --- a/crawl-ref/source/externs.h +++ b/crawl-ref/source/externs.h @@ -1243,10 +1243,43 @@ struct map_cell bool seen() const; }; -typedef FixedArray<dungeon_feature_type, GXM, GYM> feature_grid; class map_marker; -typedef std::multimap<coord_def, map_marker *> dgn_marker_map; -typedef std::pair<coord_def, map_marker *> dgn_pos_marker; +class tagHeader; +class map_markers +{ +public: + map_markers(); + map_markers(const map_markers &); + map_markers &operator = (const map_markers &); + ~map_markers(); + + void activate_all(); + void add(map_marker *marker); + void remove(map_marker *marker); + void remove_markers_at(const coord_def &c, map_marker_type type = MAT_ANY); + map_marker *find(const coord_def &c, map_marker_type type = MAT_ANY); + map_marker *find(map_marker_type type); + void move(const coord_def &from, const coord_def &to); + std::vector<map_marker*> get_all(map_marker_type type = MAT_ANY); + std::vector<map_marker*> get_markers_at(const coord_def &c); + std::string property_at(const coord_def &c, map_marker_type type, + const std::string &key); + void clear(); + + void write(tagHeader &th) const; + void read(tagHeader &); + +private: + typedef std::multimap<coord_def, map_marker *> dgn_marker_map; + typedef std::pair<coord_def, map_marker *> dgn_pos_marker; + + void init_from(const map_markers &); + +private: + dgn_marker_map markers; +}; + +typedef FixedArray<dungeon_feature_type, GXM, GYM> feature_grid; struct crawl_environment { @@ -1277,7 +1310,7 @@ public: FixedVector< trap_struct, MAX_TRAPS > trap; // trap list FixedVector< int, 20 > mons_alloc; - dgn_marker_map markers; + map_markers markers; double elapsed_time; // used during level load |