TreeTemplate.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include "GeneratorTemplate.h"
  3. #include "TypeRegistry.h"
  4. class TreeTemplate : public GeneratorTemplate
  5. {
  6. private:
  7. int woodBlockTypeId;
  8. int leaveBlockType;
  9. int minHeight;
  10. int maxHeight;
  11. public:
  12. TreeTemplate();
  13. virtual GeneratedStructure* generateAt(
  14. Framework::Vec3<int> location, Noise* zNoise, int dimensionId) override;
  15. void setWoodTypeId(int id);
  16. void setLeavesTypeId(int id);
  17. const BlockType* zWoodType() const;
  18. const BlockType* zLeavesType() const;
  19. void setMinHeight(int height);
  20. void setMaxHeight(int height);
  21. int getMinHeight() const;
  22. int getMaxHeight() const;
  23. };
  24. class TreeTemplateFactory : public GeneratorTemplateFactory<TreeTemplate>
  25. {
  26. public:
  27. TreeTemplateFactory();
  28. TreeTemplate* createValue(
  29. Framework::JSON::JSONObject* zJson) const override;
  30. void fromJson(TreeTemplate* zResult,
  31. Framework::JSON::JSONObject* zConfig) const override;
  32. void toJson(TreeTemplate* zObject,
  33. Framework::JSON::JSONObject* zResult) const override;
  34. JSONObjectValidationBuilder* addToValidator(
  35. JSONObjectValidationBuilder* builder) const override;
  36. virtual Framework::Text getTypeToken() const override;
  37. };