class Generator {
public:
- explicit Generator(unsigned int seed);
+ struct Config {
+ unsigned int solid_seed = 0;
+ unsigned int type_seed = 0;
+ float stretch = 64.0f;
+ float solid_threshold = 0.5f;
+ };
- void operator ()(Chunk &) const;
+ explicit Generator(const Config &) noexcept;
- void Space(Block::Type t) { space = t; }
+ void operator ()(Chunk &) const noexcept;
+
+ void Space(Block::Type t) noexcept { space = t; }
+ void Light(Block::Type t) noexcept { light = t; }
void Solids(const std::vector<Block::Type> &s) { solids = s; }
private:
SimplexNoise solidNoise;
- SimplexNoise typeNoise;
+ WorleyNoise typeNoise;
float stretch;
float solid_threshold;
Block::Type space;
+ Block::Type light;
std::vector<Block::Type> solids;
};