BiomGenerator.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. #include <Either.h>
  3. #include <JSON.h>
  4. #include <ReferenceCounter.h>
  5. #include "GeneratorRule.h"
  6. #include "JNoise.h"
  7. #include "JsonExpression.h"
  8. #include "StructureCollection.h"
  9. class Block;
  10. class Noise;
  11. class BiomGenerator : public virtual Framework::ReferenceCounter
  12. {
  13. private:
  14. Framework::Text name;
  15. Framework::RCArray<StructureTemplateCollection> templates;
  16. Framework::RCArray<GeneratorRule> rules;
  17. JBoolExpression* condition;
  18. Framework::Vec3<int> minStructureOffset;
  19. Framework::Vec3<int> maxStructureOffset;
  20. protected:
  21. int seed;
  22. public:
  23. BiomGenerator(
  24. Framework::JSON::JSONValue* zConfig, JExpressionMemory* zMemory);
  25. Framework::Either<Block*, int> generateBlock(int x,
  26. int y,
  27. int z,
  28. int dimensionId,
  29. JExpressionMemory* zMemory,
  30. Chunk* partialGeneratedChunk);
  31. bool isApplicable(JExpressionMemory* zMemory);
  32. void generateStructures(int x,
  33. int y,
  34. int z,
  35. int dimensionId,
  36. JExpressionMemory* zMemory,
  37. Framework::Vec3<int> minPos,
  38. Framework::Vec3<int> maxPos,
  39. Framework::RCArray<GeneratedStructure>* zResult);
  40. const Framework::RCArray<StructureTemplateCollection>& getTemplates() const;
  41. Framework::Vec3<int> getMinStructureOffset() const;
  42. Framework::Vec3<int> getMaxStructureOffset() const;
  43. static Framework::JSON::Validator::JSONValidator* getConfigValidator();
  44. };