diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-05-09 19:52:59 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-05-09 19:52:59 +0000 |
commit | d69688f0d70ebd684181678a77ca10f800258cfe (patch) | |
tree | 19b8b9fdd4c8194ea65d0729cdf44adf31ee7e60 /crawl-ref/source/mapdef.h | |
parent | b31a9edb3090aa8dac6dc1fc70c5e241c3019642 (diff) | |
download | crawl-ref-d69688f0d70ebd684181678a77ca10f800258cfe.tar.gz crawl-ref-d69688f0d70ebd684181678a77ca10f800258cfe.zip |
Added Lemuel's mines minivaults.
Extended map DEPTH: attribute to support branch specifiers and negated depth
specifiers.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1442 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mapdef.h')
-rw-r--r-- | crawl-ref/source/mapdef.h | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/crawl-ref/source/mapdef.h b/crawl-ref/source/mapdef.h index ffb5cef40e..3d5866af96 100644 --- a/crawl-ref/source/mapdef.h +++ b/crawl-ref/source/mapdef.h @@ -24,20 +24,38 @@ enum map_flags MAPF_ROTATE = 0x40 // may be rotated }; -class level_range +struct raw_range +{ + branch_type branch; + int shallowest, deepest; + bool deny; +}; + +struct level_range { public: + branch_type branch; int shallowest, deepest; + bool deny; public: - level_range(int s = -1, int d = -1); + level_range(const raw_range &range); + level_range(branch_type br = BRANCH_MAIN_DUNGEON, int s = -1, int d = -1); void set(int s, int d = -1); + void set(const std::string &branch, int s, int d) throw (std::string); + void reset(); - bool contains(int depth) const; + bool matches(const level_id &) const; + bool matches(int depth) const; bool valid() const; int span() const; + + std::string describe() const; + std::string str_depth_range() const; + + operator raw_range () const; }; typedef std::pair<int,int> glyph_weighted_replacement_t; @@ -328,6 +346,8 @@ private: typedef std::map<int, keyed_mapspec> keyed_specs; +typedef std::vector<level_range> depth_ranges; + // Not providing a constructor to make life easy for C-style initialisation. class map_def { @@ -335,7 +355,8 @@ public: std::string name; std::string tags; std::string place; - level_range depth; + + depth_ranges depths; map_section_type orient; int chance; long flags; @@ -355,7 +376,14 @@ public: void resolve(); void fixup(); + bool is_usable_in(const level_id &lid) const; + keyed_mapspec *mapspec_for_key(int key); + + bool has_depth() const; + void add_depth(const level_range &depth); + void add_depths(depth_ranges::const_iterator s, + depth_ranges::const_iterator e); std::string add_key_item(const std::string &s); std::string add_key_mons(const std::string &s); @@ -369,6 +397,7 @@ public: bool is_minivault() const; bool has_tag(const std::string &tag) const; + bool has_tag_prefix(const std::string &tag) const; private: std::string add_key_field( |