12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #pragma once
- #include <Array.h>
- #include <Either.h>
- #include <ReferenceCounter.h>
- #include "BiomGenerator.h"
- #include "CaveGenerator.h"
- #include "Chunk.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;
- };
|