123456789101112131415161718192021222324252627282930313233343536373839 |
- #pragma once
- #include "GeneratorTemplate.h"
- #include "TypeRegistry.h"
- class TreeTemplate : public GeneratorTemplate
- {
- private:
- int woodBlockTypeId;
- int leaveBlockType;
- int minHeight;
- int maxHeight;
- public:
- TreeTemplate(float propability,
- int woodBlockTypeId,
- int leaveBlockType,
- int minHeight,
- int maxHeight);
- virtual GeneratedStructure* generateAt(
- Framework::Vec3<int> location, Noise* zNoise, int dimensionId) override;
- const BlockType* getWoodType() const;
- const BlockType* getLeavesType() const;
- friend class TreeTemplateFactory;
- };
- class TreeTemplateFactory
- : public SubTypeFactory<GeneratorTemplate, TreeTemplate>
- {
- public:
- TreeTemplateFactory();
- TreeTemplate* fromJson(Framework::JSON::JSONObject* zConfig) const override;
- Framework::JSON::JSONObject* toJson(TreeTemplate* zObject) const override;
- Framework::JSON::Validator::JSONValidator* getValidator(
- Framework::JSON::Validator::ObjectValidationBuilder<
- Framework::JSON::Validator::JSONValidator>* builder) const override;
- virtual Framework::Text getTypeToken() const override;
- };
|