summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/branch.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-25 01:01:34 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-25 01:01:34 +0000
commit25827049ebef8e9335375d01a5c77468bd9a3b08 (patch)
tree3625d296a964a7af9e6e249f45e8f84b88fe9a85 /crawl-ref/source/branch.cc
parentf53c0fd020b3619b8488f23793c08fd39c160f29 (diff)
downloadcrawl-ref-25827049ebef8e9335375d01a5c77468bd9a3b08.tar.gz
crawl-ref-25827049ebef8e9335375d01a5c77468bd9a3b08.zip
Enable vault generation for non-LEVEL_DUNGEON levels, make ziggurat eligible for random gen in main dungeon and Pan; still needs entry portal timing/charging fixes, and ziggurat builder is still incomplete.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7601 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/branch.cc')
-rw-r--r--crawl-ref/source/branch.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/crawl-ref/source/branch.cc b/crawl-ref/source/branch.cc
index 2df448e731..1aef71e6a9 100644
--- a/crawl-ref/source/branch.cc
+++ b/crawl-ref/source/branch.cc
@@ -34,6 +34,27 @@ branch_type str_to_branch(const std::string &branch, branch_type err)
return (err);
}
+static const char *level_type_names[] =
+{
+ "D", "Lab", "Abyss", "Pan", "Port"
+};
+
+const char *level_area_type_name(int level_type)
+{
+ if (level_type >= 0 && level_type < NUM_LEVEL_AREA_TYPES)
+ return level_type_names[level_type];
+ return ("");
+}
+
+level_area_type str_to_level_area_type(const std::string &s)
+{
+ for (int i = 0; i < NUM_LEVEL_AREA_TYPES; ++i)
+ if (s == level_type_names[i])
+ return (static_cast<level_area_type>(i));
+
+ return (LEVEL_DUNGEON);
+}
+
bool set_branch_flags(unsigned long flags, bool silent,
branch_type branch)
{