summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/travel.h
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2011-06-11 22:56:25 +0200
committerRaphael Langella <raphael.langella@gmail.com>2011-06-12 00:18:58 +0200
commit8d595aab955c10796a119f22f4e32ae1127c25a4 (patch)
tree4c76a7ea4e38d3140c2945dd5c6c694c78370f72 /crawl-ref/source/travel.h
parentf7724b9cf3e432119fb95fa5df4605efa8eb0621 (diff)
downloadcrawl-ref-8d595aab955c10796a119f22f4e32ae1127c25a4.tar.gz
crawl-ref-8d595aab955c10796a119f22f4e32ae1127c25a4.zip
Improve autoexplore by trying to have a look at unreachable places.
It's mostly useful in Lair and Slime. It's far from the optimal explore path since it will only happen on the second flood. It means it will start by exploring reachable points and once done will try to take a look at unreachable ones. Doing it sooner would be way too taxing anyway, since it involves LOS iteration, and it's not really possible anyway. The list of unreachable points is saved in a set, so it could be possible to propose seeing them in map mode to the player.
Diffstat (limited to 'crawl-ref/source/travel.h')
-rw-r--r--crawl-ref/source/travel.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h
index 201c538618..95a4c213b0 100644
--- a/crawl-ref/source/travel.h
+++ b/crawl-ref/source/travel.h
@@ -42,9 +42,9 @@ enum run_dir_type
enum run_mode_type
{
- RMODE_INTERLEVEL = -4, // Interlevel travel (Ctrl+G)
- RMODE_EXPLORE_GREEDY = -3, // Explore + grab items (Tab/Ctrl+I)
- RMODE_EXPLORE = -2, // Exploring (Ctrl+O)
+ RMODE_INTERLEVEL = -4, // Interlevel travel
+ RMODE_EXPLORE_GREEDY = -3, // Explore + grab items
+ RMODE_EXPLORE = -2, // Exploring
RMODE_TRAVEL = -1, // Classic or Plain Old travel
RMODE_NOT_RUNNING = 0, // must remain equal to 0
RMODE_CONTINUE,
@@ -502,6 +502,8 @@ public:
// Extract features without pathfinding
void get_features();
+ const std::set<coord_def> get_unreachables() const;
+
// The next square to go to to move towards the travel destination. Return
// value is undefined if pathfind was not called with RMODE_TRAVEL.
const coord_def travel_move() const;
@@ -585,6 +587,9 @@ protected:
std::vector<coord_def> *features;
+ // List of unexplored and unreachable points.
+ std::set<coord_def> unreachables;
+
travel_distance_col *point_distance;
// How many points are we currently considering? We start off with just one