summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/map_knowledge.h
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-11-08 14:23:03 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-08 14:46:22 +0100
commit28f6c800df6bc63658b9c79e803bf81ac282aa1d (patch)
treedf593b87768f0324939f89ed6f4d7aea8c950de4 /crawl-ref/source/map_knowledge.h
parenta4eda3c37bb9ec6d9b847e827390a66062229b99 (diff)
downloadcrawl-ref-28f6c800df6bc63658b9c79e803bf81ac282aa1d.tar.gz
crawl-ref-28f6c800df6bc63658b9c79e803bf81ac282aa1d.zip
Split map knowledge and FPROPs.
map_cell no longer has the field "properties", which has been replaced by the unsigned long array env.pgrid. env.map has been renamed to env.map_knowledge. It should really be moved into player.
Diffstat (limited to 'crawl-ref/source/map_knowledge.h')
-rw-r--r--crawl-ref/source/map_knowledge.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/crawl-ref/source/map_knowledge.h b/crawl-ref/source/map_knowledge.h
new file mode 100644
index 0000000000..4c9a6954f9
--- /dev/null
+++ b/crawl-ref/source/map_knowledge.h
@@ -0,0 +1,96 @@
+#ifndef MAP_KNOWLEDGE_H
+#define MAP_KNOWLEDGE_H
+
+#include "show.h"
+
+/*
+ * A map_cell stores what the player knows about a cell.
+ * These go in env.map_knowledge_knowledge.
+ */
+struct map_cell
+{
+ show_type object; // The object: monster, item, feature, or cloud.
+ unsigned short flags; // Flags describing the mappedness of this square.
+ unsigned short colour;
+
+ map_cell() : object(), flags(0), colour(0) { }
+ void clear() { flags = colour = 0; object = show_type(); }
+
+ unsigned glyph() const;
+ bool known() const;
+ bool seen() const;
+};
+
+void set_map_knowledge_obj(const coord_def& where, show_type object);
+unsigned get_map_knowledge_char(int x, int y);
+inline unsigned get_map_knowledge_char(const coord_def& c) {
+ return get_map_knowledge_char(c.x, c.y);
+}
+show_type get_map_knowledge_obj(int x, int y);
+inline show_type get_map_knowledge_obj(const coord_def& c) {
+ return get_map_knowledge_obj(c.x, c.y);
+}
+void set_map_knowledge_detected_item(int x, int y, bool detected = true);
+inline void set_map_knowledge_detected_item(const coord_def& c, bool detected = true) {
+ set_map_knowledge_detected_item(c.x, c.y, detected);
+}
+
+void set_map_knowledge_detected_mons(int x, int y, bool detected = true);
+inline void set_map_knowledge_detected_mons(const coord_def& c, bool detected = true) {
+ set_map_knowledge_detected_mons(c.x, c.y, detected);
+}
+void set_map_knowledge_col( int x, int y, int colour, int flags );
+void set_map_knowledge_col( int x, int y, int colour );
+
+bool is_map_knowledge_detected_item(int x, int y);
+inline bool is_map_knowledge_detected_item(const coord_def& c) {
+ return is_map_knowledge_detected_item(c.x, c.y);
+}
+
+bool is_map_knowledge_detected_mons(int x, int y);
+inline bool is_map_knowledge_detected_mons(const coord_def& c) {
+ return is_map_knowledge_detected_mons(c.x, c.y);
+}
+bool is_map_knowledge_item(int x, int y);
+inline bool is_map_knowledge_item(const coord_def& c) {
+ return is_map_knowledge_item(c.x, c.y);
+}
+void set_terrain_mapped( int x, int y );
+inline void set_terrain_mapped( const coord_def& c ) {
+ set_terrain_mapped(c.x,c.y);
+}
+void set_terrain_seen( int x, int y );
+inline void set_terrain_seen( const coord_def& c ) {
+ set_terrain_seen(c.x, c.y);
+}
+void set_terrain_changed( int x, int y );
+bool is_terrain_known( int x, int y );
+bool is_terrain_seen( int x, int y );
+bool is_terrain_changed( int x, int y );
+inline bool is_terrain_changed( const coord_def& c ) {
+ return is_terrain_changed(c.x,c.y);
+}
+bool is_terrain_known(const coord_def &p);
+bool is_terrain_mapped(const coord_def &p);
+bool is_notable_terrain(dungeon_feature_type ftype);
+
+inline bool is_terrain_seen(const coord_def &c)
+{
+ return (is_terrain_seen(c.x, c.y));
+}
+
+inline void set_terrain_changed(const coord_def &c)
+{
+ set_terrain_changed(c.x, c.y);
+}
+
+int count_detected_mons(void);
+void clear_map(bool clear_items = true, bool clear_mons = true);
+
+int get_map_knowledge_col(const coord_def& p);
+
+void set_map_knowledge_glyph(const coord_def& c, show_type object, int col);
+
+void clear_map_knowledge_grid(const coord_def& p);
+
+#endif