#pragma once

#include "GeneratorTemplate.h"
#include "TypeRegistry.h"

class TreeTemplate : public GeneratorTemplate
{
private:
    int woodBlockTypeId;
    int leaveBlockType;
    int minHeight;
    int maxHeight;

public:
    TreeTemplate();
    virtual GeneratedStructure* generateAt(
        Framework::Vec3<int> location, Noise* zNoise, int dimensionId) override;
    void setWoodTypeId(int id);
    void setLeavesTypeId(int id);
    const BlockType* zWoodType() const;
    const BlockType* zLeavesType() const;
    void setMinHeight(int height);
    void setMaxHeight(int height);
    int getMinHeight() const;
    int getMaxHeight() const;
};

class TreeTemplateFactory : public GeneratorTemplateFactory<TreeTemplate>
{
public:
    TreeTemplateFactory();
    TreeTemplate* createValue(
        Framework::JSON::JSONObject* zJson) const override;
    TreeTemplate* fromJson(Framework::JSON::JSONObject* zConfig) const override;
    Framework::JSON::JSONObject* toJsonObject(
        TreeTemplate* zObject) const override;
    JSONObjectValidationBuilder* addToValidator(
        JSONObjectValidationBuilder* builder) const override;
    const char* getTypeToken() const override;
};