1234567891011121314151617181920212223242526272829303132333435363738394041 |
- #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;
- 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;
- };
|