#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 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 { public: TreeTemplateFactory(); TreeTemplate* createValue( Framework::JSON::JSONObject* zJson) const override; void fromJson(TreeTemplate* zResult, Framework::JSON::JSONObject* zConfig) const override; void toJson(TreeTemplate* zObject, Framework::JSON::JSONObject* zResult) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; virtual Framework::Text getTypeToken() const override; };