1234567891011121314151617181920212223242526272829303132 |
- #pragma once
- #include <Critical.h>
- #include <Thread.h>
- #include "Area.h"
- #include "DimensionGenerator.h"
- class WorldGenerator : public Framework::Thread
- {
- private:
- Framework::Critical cs;
- Framework::Array<Area> requestQueue;
- Framework::RCArray<DimensionGenerator> dimensionGenerators;
- bool exit;
- int seed;
- DimensionGenerator* zGenerator(int dimensionId);
- public:
- WorldGenerator(int seed);
- ~WorldGenerator();
- Dimension *createDimension(int dimensionId);
- void thread() override;
- void requestGeneration(Area request);
- void exitAndWait();
- Framework::Either<Block*, int> generateSingleBlock(
- Framework::Vec3<int> location, int dimensionId);
- bool spawnStructure(Framework::Vec3<int> location,
- int dimensionId,
- std::function<bool(GeneratorTemplate* tmpl)> filter);
- };
|