git-svn-id: http://mc-server.googlecode.com/svn/trunk@293 0a769ca7-a7f5-676a-18bf-c427514a06d6
45 lines
959 B
C++
45 lines
959 B
C++
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
#include "cChunk.h"
|
|
#include "MersenneTwister.h"
|
|
|
|
|
|
|
|
|
|
|
|
class cWorldGenerator
|
|
{
|
|
public:
|
|
cWorldGenerator(cWorld * a_World);
|
|
~cWorldGenerator();
|
|
|
|
virtual void GenerateChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, char * a_BlockData, cEntityList & a_Entities, cBlockEntityList & a_BlockEntities);
|
|
|
|
virtual void PostGenerateChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ); // Called when the chunk has been already generated and set valid
|
|
|
|
protected:
|
|
|
|
cWorld * m_World;
|
|
|
|
// Thread-unsafe:
|
|
MTRand r1;
|
|
|
|
static unsigned int MakeIndex(int x, int y, int z );
|
|
|
|
virtual void GenerateTerrain(int a_ChunkX, int a_ChunkY, int a_ChunkZ, char * a_BlockData);
|
|
|
|
virtual void GenerateFoliage(int a_ChunkX, int a_ChunkY, int a_ChunkZ);
|
|
|
|
/// Checks if the chunk has all 8 neighbors valid, if so, foliage is generated on that chunk
|
|
void CheckNeighbors(int a_ChunkX, int a_ChunkY, int a_ChunkZ);
|
|
};
|
|
|
|
|
|
|
|
|