WorldGenerator.h 679 B

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include <Critical.h>
  3. #include <Thread.h>
  4. #include "Area.h"
  5. #include "DimensionGenerator.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(
  20. Framework::Vec3<int> location, int dimensionId);
  21. bool spawnStructure(Framework::Vec3<int> location,
  22. int dimensionId,
  23. std::function<bool(GenerationTemplate* tmpl)> filter);
  24. };