]> git.localhorst.tv Git - blank.git/blobdiff - src/generator.hpp
separate file for world generation
[blank.git] / src / generator.hpp
diff --git a/src/generator.hpp b/src/generator.hpp
new file mode 100644 (file)
index 0000000..a40184b
--- /dev/null
@@ -0,0 +1,35 @@
+#ifndef BLANK_GENERATOR_HPP_
+#define BLANK_GENERATOR_HPP_
+
+#include "block.hpp"
+#include "chunk.hpp"
+#include "noise.hpp"
+
+#include <vector>
+
+
+namespace blank {
+
+class Generator {
+
+public:
+       explicit Generator(unsigned int seed);
+
+       void operator ()(Chunk &) const;
+
+       void Solids(const std::vector<Block::Type> &s) { solids = s; }
+
+private:
+       SimplexNoise solidNoise;
+       SimplexNoise typeNoise;
+
+       float stretch;
+       float solid_threshold;
+
+       std::vector<Block::Type> solids;
+
+};
+
+}
+
+#endif