From 7198ddba466447ce8b9fabc01ae6311cac6700b2 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Thu, 19 Jul 2012 21:49:27 +0000 Subject: Ravines: initial implementation, randomized shapes are working, but still needs some work git-svn-id: http://mc-server.googlecode.com/svn/trunk@683 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Ravines.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 source/Ravines.h (limited to 'source/Ravines.h') diff --git a/source/Ravines.h b/source/Ravines.h new file mode 100644 index 000000000..7d6e351db --- /dev/null +++ b/source/Ravines.h @@ -0,0 +1,54 @@ + +// Ravines.h + +// Interfaces to the cStructGenRavines class representing the ravine structure generator + + + + + +#pragma once + +#include "cChunkGenerator.h" +#include "cNoise.h" + + + + + +class cStructGenRavines : + public cStructureGen +{ +public: + cStructGenRavines(int a_Seed, int a_Size); + ~cStructGenRavines(); + +protected: + class cRavine; // fwd: Ravines.cpp + typedef std::list cRavines; + + cNoise m_Noise; + int m_Seed; + int m_Size; // Max size, in blocks, of the ravines generated + cRavines m_Cache; + + /// Clears everything from the cache + void ClearCache(void); + + /// Returns all ravines that *may* intersect the given chunk. All the ravines are valid until the next call to this function. + void GetRavinesForChunk(int a_ChunkX, int a_ChunkZ, cRavines & a_Ravines); + + // cStructureGen override: + virtual void GenStructures( + int a_ChunkX, int a_ChunkZ, + cChunkDef::BlockTypes & a_BlockTypes, // Block types to read and change + cChunkDef::BlockNibbles & a_BlockMeta, // Block meta to read and change + cChunkDef::HeightMap & a_HeightMap, // Height map to read and change by the current data + cEntityList & a_Entities, // Entities may be added or deleted + cBlockEntityList & a_BlockEntities // Block entities may be added or deleted + ) override; +} ; + + + + -- cgit v1.2.3