#ifndef FLAT_WORLD_GENERATOR_HPP_
#define FLAT_WORLD_GENERATOR_HPP_

#include <Serialize/Serialize.hpp>
#include <WorldGenerator/WorldGenerator.hpp>
#include <World/LocalWorld/LocalWorld.hpp>

class FlatWorldGenerator final : public WorldGenerator
{
public:
    /**
     * @brief The layer specification as saved in the world index.
     */
    struct LayerSpec
    {
        std::string blockName;
        uint32_t depth;
    };

private:
    std::vector<int> layerBlockIds;
    int bottomBlockId;

public:
    FlatWorldGenerator(
        LocalWorld &world,
        const std::vector<LayerSpec> &layers,
        const std::string &bottomBlockName
    );

    virtual void generateChunk(Chunk &chunk) override;
    virtual GeneratorNode getWeatherGenNode() override;
};

DERIVE_STRUCT_SERIALIZER(FlatWorldGenerator::LayerSpec, self.blockName, self.depth);

#endif