DimensionGenerator.h 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include <Array.h>
  3. #include <ReferenceCounter.h>
  4. #include <Either.h>
  5. #include "BiomGenerator.h"
  6. #include "Chunk.h"
  7. class DimensionGenerator : public virtual Framework::ReferenceCounter
  8. {
  9. private:
  10. Framework::RCArray<BiomGenerator> biomGenerators;
  11. Framework::Array<double> biomDistribution;
  12. const int dimensionId;
  13. Framework::Vec3<int> minTemplateAffectedPosition;
  14. Framework::Vec3<int> maxTemplateAffectedPosition;
  15. BiomGenerator* zBiomGenerator(int seed, int x, int y);
  16. protected:
  17. DimensionGenerator(int dimensionId);
  18. ~DimensionGenerator();
  19. void registerBiom(BiomGenerator* generator, double possibility);
  20. Framework::RCArray<GeneratedStructure>* getGeneratedStructoresForArea(int seed, Framework::Vec3<int> minPos, Framework::Vec3<int> maxPos);
  21. public:
  22. Chunk* generateChunk(int seed, int centerX, int centerY);
  23. Framework::Either<Block*, int> generateBlock(int seed, Framework::Vec3<int> location);
  24. int getDimensionId() const;
  25. virtual Noise* zBiomNoise(int seed) = 0;
  26. virtual Noise* zStructureNoise(int seed) = 0;
  27. };