1234567891011121314151617181920212223242526272829303132 |
- #include "GrasslandBiom.h"
- #include "BlockType.h"
- #include "BasicBlocks.h"
- #include "FastNoiseLite.h"
- #include "FastNoiseWrapper.h"
- GrasslandBiom::GrasslandBiom()
- : BiomGenerator()
- {
- heightNoise = 0;
- }
- GrasslandBiom::~GrasslandBiom()
- {
- if( heightNoise )
- heightNoise->release();
- }
- Framework::Either<Block*, int> GrasslandBiom::getBlock( int x, int y, int z )
- {
- return DirtBlockType::ID;
- }
- Noise* GrasslandBiom::zHeightMapNoise( int seed )
- {
- if( heightNoise )
- return heightNoise;
- FastNoiseLite* noise = new FastNoiseLite( seed );
- noise->SetNoiseType( FastNoiseLite::NoiseType::NoiseType_ValueCubic );
- heightNoise = new FastNoiseWrapper( noise, seed );
- return heightNoise;
- }
|