summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/place.h
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-15 23:33:50 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-15 23:33:50 +0000
commitfa763ba1bc7285247a5b1438d59633383a80cf6c (patch)
treef4b632fea66f43dc6c1415fdaa4feead0b6ff90d /crawl-ref/source/place.h
parent4d88632cb99d368956dec86732f7d275ffb941e8 (diff)
downloadcrawl-ref-fa763ba1bc7285247a5b1438d59633383a80cf6c.tar.gz
crawl-ref-fa763ba1bc7285247a5b1438d59633383a80cf6c.zip
Split off portions of externs.h and enum.h into other files. The
crawl_environment, player and monsters classes have been left in externs.h, which necessitates that all of the enums references by those classes stay in enums.h, since you can't forward declare an enum. However, it's a start. Also, portions of misc.{cc,h} have been split off into traps.{cc,h}, place.{cc,h} and terrain.{cc,h} git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2095 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/place.h')
-rw-r--r--crawl-ref/source/place.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/crawl-ref/source/place.h b/crawl-ref/source/place.h
new file mode 100644
index 0000000000..32eba39987
--- /dev/null
+++ b/crawl-ref/source/place.h
@@ -0,0 +1,53 @@
+/*
+ * File: place.h
+ * Summary: Place related functions.
+ * Written by: Linley Henzell
+ *
+ * Modified for Crawl Reference by $Author: j-p-e-g $ on $Date: 2007-09-03 06:41:30 -0700 (Mon, 03 Sep 2007) $
+ *
+ * Change History (most recent first):
+ *
+ * <1> 9/11/07 MPC Split from misc.h
+ */
+
+#ifndef PLACE_H
+#define PLACE_H
+
+#include "enum.h"
+
+//////////////////////////////////////////////////////////////////////
+// Places and names
+//
+unsigned short get_packed_place();
+
+unsigned short get_packed_place( branch_type branch, int subdepth,
+ level_area_type level_type );
+
+int place_branch(unsigned short place);
+int place_depth(unsigned short place);
+std::string short_place_name(unsigned short place);
+std::string short_place_name(level_id id);
+std::string place_name( unsigned short place, bool long_name = false,
+ bool include_number = true );
+
+// Prepositional form of branch level name. For example, "in the
+// Abyss" or "on level 3 of the Main Dungeon".
+std::string prep_branch_level_name(unsigned short packed_place);
+std::string prep_branch_level_name();
+
+// Get displayable depth in the current branch, given the absolute
+// depth.
+int subdungeon_depth(branch_type branch, int depth);
+
+// Get absolute depth given the displayable depth in the branch.
+int absdungeon_depth(branch_type branch, int subdepth);
+
+// Get displayable depth in the current branch.
+int player_branch_depth();
+
+bool single_level_branch(branch_type branch);
+
+bool level_type_exits_up(level_area_type type);
+bool level_type_exits_down(level_area_type type);
+
+#endif