From 25827049ebef8e9335375d01a5c77468bd9a3b08 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Tue, 25 Nov 2008 01:01:34 +0000 Subject: 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 --- crawl-ref/source/branch.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'crawl-ref/source/branch.cc') 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(i)); + + return (LEVEL_DUNGEON); +} + bool set_branch_flags(unsigned long flags, bool silent, branch_type branch) { -- cgit v1.2.3-54-g00ecf