summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/bitary.h
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/bitary.h')
-rw-r--r--crawl-ref/source/bitary.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/crawl-ref/source/bitary.h b/crawl-ref/source/bitary.h
new file mode 100644
index 0000000000..110a9e846c
--- /dev/null
+++ b/crawl-ref/source/bitary.h
@@ -0,0 +1,35 @@
+/*
+ * File: bitary.h
+ * Summary: Bit array data type.
+ * Created by: Robert Vollmert
+ *
+ * Just contains the operations required by los.cc
+ * for the moment.
+ */
+
+#ifndef BITARY_H
+#define BITARY_H
+
+struct bit_array
+{
+public:
+ bit_array(unsigned long size = 0);
+ ~bit_array();
+
+ void reset();
+
+ bool get(unsigned long index) const;
+ void set(unsigned long index, bool value = true);
+
+ bit_array& operator |= (const bit_array& other);
+ bit_array& operator &= (const bit_array& other);
+ bit_array operator & (const bit_array& other) const;
+
+protected:
+ unsigned long size;
+ int nwords;
+ unsigned long *data;
+};
+
+#endif
+