WorldGenerator.h 622 B

1234567891011121314151617181920212223242526
  1. #pragma once
  2. #include <Thread.h>
  3. #include <Critical.h>
  4. #include "DimensionGenerator.h"
  5. #include "Area.h"
  6. class WorldGenerator : public Framework::Thread
  7. {
  8. private:
  9. Framework::Critical cs;
  10. Framework::Array<Area> requestQueue;
  11. bool exit;
  12. int seed;
  13. public:
  14. WorldGenerator(int seed);
  15. ~WorldGenerator();
  16. void thread() override;
  17. void requestGeneration(Area request);
  18. void exitAndWait();
  19. Framework::Either<Block*, int> generateSingleBlock(Framework::Vec3<int> location, int dimensionId);
  20. bool spawnStructure(Framework::Vec3<int> location, int dimensionId, std::function<bool(GenerationTemplate* tmpl)> filter);
  21. };