summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dgn-proclayouts.h
diff options
context:
space:
mode:
authorBrendan Hickey <brendan@bhickey.net>2012-09-03 16:39:01 -0700
committerBrendan Hickey <brendan@bhickey.net>2012-12-30 19:06:09 -0800
commit2186d5db8c08fae528a90580b397d0007ced272f (patch)
tree4468f24dd6e8c54a20f8a7da3a754707460c1198 /crawl-ref/source/dgn-proclayouts.h
parent706b2d18b3fd6396b94b7eaed7ffb7c726acc5e5 (diff)
downloadcrawl-ref-2186d5db8c08fae528a90580b397d0007ced272f.tar.gz
crawl-ref-2186d5db8c08fae528a90580b397d0007ced272f.zip
Procedural Dungeon Generators!
Procedural Dungeon generators consume a coordinate and output dungeon terrain. The idea is to compose them for interesting results. This commit forces the abyss to use a 2x2 column layout.
Diffstat (limited to 'crawl-ref/source/dgn-proclayouts.h')
-rw-r--r--crawl-ref/source/dgn-proclayouts.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/crawl-ref/source/dgn-proclayouts.h b/crawl-ref/source/dgn-proclayouts.h
new file mode 100644
index 0000000000..1d9a009f71
--- /dev/null
+++ b/crawl-ref/source/dgn-proclayouts.h
@@ -0,0 +1,36 @@
+/**
+ * @file
+ * @brief Procedurally generated dungeon layouts.
+**/
+
+#ifndef PROC_LAYOUTS_H
+#define PROC_LAYOUTS_H
+
+#include "AppHdr.h"
+
+#include "enum.h"
+#include "externs.h"
+
+class ProceduralLayout
+{
+ public:
+ virtual dungeon_feature_type get(const coord_def &p) = 0;
+};
+
+class ColumnLayout : public ProceduralLayout
+{
+ public:
+ ColumnLayout(int cw, int cs = -1, int rw = -1, int rs = -1)
+ {
+ cs = (cs < 0 ? cw : cs);
+ _col_width = cw;
+ _col_space = cs;
+ _row_width = (rw < 0 ? cw : rw);
+ _row_space = (rs < 0 ? cs : rs);
+ }
+ dungeon_feature_type get(const coord_def &p);
+ private:
+ int _col_width, _col_space, _row_width, _row_space;
+};
+
+#endif /* PROC_LAYOUTS_H */