1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #pragma once
- #include <Array.h>
- #include <ReferenceCounter.h>
- #include <Either.h>
- #include "BiomGenerator.h"
- #include "Chunk.h"
- #include "CaveGenerator.h"
- class DimensionEnum
- {
- public:
- static const int OVERWORLD = 0;
- };
- class DimensionGenerator : public virtual Framework::ReferenceCounter
- {
- private:
- Framework::RCArray<BiomGenerator> biomGenerators;
- Framework::Array<double> biomDistribution;
- const int dimensionId;
- Framework::Vec3<int> minTemplateAffectedPosition;
- Framework::Vec3<int> maxTemplateAffectedPosition;
- CaveGenerator* caveGenerator;
- BiomGenerator* zBiomGenerator(int x, int y);
- protected:
- int seed;
- DimensionGenerator(int dimensionId, CaveGenerator* caveGenerator);
- ~DimensionGenerator();
- void registerBiom(BiomGenerator* generator, double possibility);
- Framework::RCArray<GeneratedStructure>* getGeneratedStructoresForArea(Framework::Vec3<int> minPos, Framework::Vec3<int> maxPos);
- public:
- void initialize(int seed);
- Chunk* generateChunk(int centerX, int centerY);
- Framework::Either<Block*, int> generateBlock(Framework::Vec3<int> location);
- bool spawnStructure(Framework::Vec3<int> location, std::function<bool(GenerationTemplate* tmpl)> filter);
- int getDimensionId() const;
- virtual Noise* zBiomNoise() = 0;
- virtual Noise* zStructureNoise() = 0;
- };
|