summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/travel.h
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-05 13:22:21 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-05 13:22:21 +0000
commit3edb4c171ba3f6ceab0c74374beb70ebbec7a264 (patch)
tree5e2e62494feace5a66520a127c56b3b8f099791c /crawl-ref/source/travel.h
parentfafa8e33e468a7092f91e57e4d6e148811760ccc (diff)
downloadcrawl-ref-3edb4c171ba3f6ceab0c74374beb70ebbec7a264.tar.gz
crawl-ref-3edb4c171ba3f6ceab0c74374beb70ebbec7a264.zip
[1748162] Allow travel to the stair to a branch or level (using ^ will go to
the entrance to any level; can also enter 0 at the depth prompt to go to a branch entrance.) Also (experimentally) unifies the level-map and interlevel travel targets. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1754 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/travel.h')
-rw-r--r--crawl-ref/source/travel.h37
1 files changed, 25 insertions, 12 deletions
diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h
index 6028282961..334797391f 100644
--- a/crawl-ref/source/travel.h
+++ b/crawl-ref/source/travel.h
@@ -60,7 +60,10 @@ bool is_travelsafe_square(int x, int y, bool ignore_hostile = false,
void start_explore(bool grab_items = false);
struct level_pos;
-void start_translevel_travel(const level_pos &pos);
+struct level_id;
+struct travel_target;
+
+void start_translevel_travel(const travel_target &pos);
void start_translevel_travel(bool prompt_for_destination = true);
@@ -74,8 +77,6 @@ void prevent_travel_to(const std::string &dungeon_feature_name);
// Sort dungeon features as appropriate.
void arrange_features(std::vector<coord_def> &features);
-
-struct level_id;
int level_distance(level_id first, level_id second);
bool can_travel_to(const level_id &lid);
@@ -95,7 +96,7 @@ enum translevel_prompt_flags
| TPF_REMEMBER_TARGET
};
-level_pos prompt_translevel_target(int prompt_flags = TPF_DEFAULT_OPTIONS);
+travel_target prompt_translevel_target(int prompt_flags = TPF_DEFAULT_OPTIONS);
// Magic numbers for point_distance:
@@ -263,6 +264,26 @@ struct level_pos
void load(FILE *);
};
+struct travel_target
+{
+ level_pos p;
+ bool entrance_only;
+
+ travel_target(const level_pos &_pos, bool entry = false)
+ : p(_pos), entrance_only(entry)
+ {
+ }
+ travel_target()
+ : p(), entrance_only(false)
+ {
+ }
+ void clear()
+ {
+ p.reset();
+ entrance_only = false;
+ }
+};
+
// Tracks items discovered by explore in this turn.
class LevelStashes;
class explore_discoveries
@@ -411,14 +432,6 @@ class TravelCache
public:
void reset_distances();
- // Get the LevelInfo for the specified level (defaults to the current
- // level).
- LevelInfo& get_level_info(branch_type branch = BRANCH_MAIN_DUNGEON,
- int depth = -1)
- {
- return get_level_info( level_id(branch, depth) );
- }
-
LevelInfo& get_level_info(const level_id &lev)
{
LevelInfo &li = levels[lev];