summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/exclude.h
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-27 03:27:26 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-10-27 03:28:33 +0100
commitacaa14cd0e82de32f1a8f76e54405023eb0b1973 (patch)
tree44be8e7c2fd611b36cdca082da22925f91515e59 /crawl-ref/source/exclude.h
parentf848a81e607b8b674e10040b899c68901662a310 (diff)
downloadcrawl-ref-acaa14cd0e82de32f1a8f76e54405023eb0b1973.tar.gz
crawl-ref-acaa14cd0e82de32f1a8f76e54405023eb0b1973.zip
Move most exclusion code from travel.cc to exclude.cc.
Diffstat (limited to 'crawl-ref/source/exclude.h')
-rw-r--r--crawl-ref/source/exclude.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/crawl-ref/source/exclude.h b/crawl-ref/source/exclude.h
index 77b1244a9e..1a39d82f53 100644
--- a/crawl-ref/source/exclude.h
+++ b/crawl-ref/source/exclude.h
@@ -1,9 +1,48 @@
#ifndef EXCLUDE_H
#define EXCLUDE_H
+#include "los.h"
+
bool need_auto_exclude(const monsters *mon, bool sleepy = false);
void set_auto_exclude(const monsters *mon);
void remove_auto_exclude(const monsters *mon, bool sleepy = false);
+void init_exclusion_los();
+void update_exclusion_los(std::vector<coord_def> changed);
+
+bool is_exclude_root(const coord_def &p);
+void cycle_exclude_radius(const coord_def &p);
+void del_exclude(const coord_def &p);
+void set_exclude(const coord_def &p, int radius = LOS_RADIUS,
+ bool autoexcl = false, bool vaultexcl = false);
+void maybe_remove_autoexclusion(const coord_def &p);
+std::string get_exclusion_desc();
+void clear_excludes();
+
+struct travel_exclude
+{
+ coord_def pos; // exclusion centre
+ int radius; // exclusion radius
+ los_def los; // los from exclusion centre
+ bool uptodate; // Is los up to date?
+ bool autoex; // Was set automatically.
+ monster_type mon; // Monster around which exclusion is centered.
+ bool vault; // Is this exclusion set by a vault?
+
+ travel_exclude(const coord_def &p, int r = LOS_RADIUS,
+ bool autoex = false, monster_type mons = MONS_NO_MONSTER,
+ bool vault = false);
+
+ int radius_sq() const;
+ void set_los();
+ bool in_bounds(const coord_def& p) const;
+ bool affects(const coord_def& p) const;
+};
+
+typedef std::vector<travel_exclude> exclvec;
+extern exclvec curr_excludes; // in travel.cc
+
+bool is_excluded(const coord_def &p, const exclvec &exc = curr_excludes);
+
#endif