diff options
author | Mattes D <github@xoft.cz> | 2014-10-28 22:29:46 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-10-28 22:29:46 +0100 |
commit | 791f8912125b8b522b8ba197f34c9e2ffb286911 (patch) | |
tree | eae9d305bd7ad06e988a6db4a03d760ded42a6ef /Tools/QtBiomeVisualiser/Region.h | |
parent | cIntGen: Added a virtual destructor. (diff) | |
parent | QtBiomeVisualiser: Added quick shutdown to region loaders. (diff) | |
download | cuberite-791f8912125b8b522b8ba197f34c9e2ffb286911.tar cuberite-791f8912125b8b522b8ba197f34c9e2ffb286911.tar.gz cuberite-791f8912125b8b522b8ba197f34c9e2ffb286911.tar.bz2 cuberite-791f8912125b8b522b8ba197f34c9e2ffb286911.tar.lz cuberite-791f8912125b8b522b8ba197f34c9e2ffb286911.tar.xz cuberite-791f8912125b8b522b8ba197f34c9e2ffb286911.tar.zst cuberite-791f8912125b8b522b8ba197f34c9e2ffb286911.zip |
Diffstat (limited to 'Tools/QtBiomeVisualiser/Region.h')
-rw-r--r-- | Tools/QtBiomeVisualiser/Region.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Tools/QtBiomeVisualiser/Region.h b/Tools/QtBiomeVisualiser/Region.h new file mode 100644 index 000000000..863c0ac02 --- /dev/null +++ b/Tools/QtBiomeVisualiser/Region.h @@ -0,0 +1,46 @@ +#pragma once + +#include "QtChunk.h" + + + + + +class Region +{ +public: + Region(); + + /** Retrieves the chunk with the specified relative coords. */ + Chunk & getRelChunk(int a_RelChunkX, int a_RelChunkZ); + + /** Returns true iff the chunk data for all chunks has been loaded. + This doesn't mean that all the chunks are valid, only that the entire region has been processed and should + be displayed. */ + bool isValid(void) const { return m_IsValid; } + + /** Returns the biome in the block coords relative to this region. + Returns biInvalidBiome if the underlying chunk is not valid. */ + int getRelBiome(int a_RelBlockX, int a_RelBlockZ); + + /** Converts block coordinates into region coordinates. */ + static void blockToRegion(int a_BlockX, int a_BlockZ, int & a_RegionX, int & a_RegionZ); + + /** Converts chunk coordinates into region coordinates. */ + static void chunkToRegion(int a_ChunkX, int a_ChunkZ, int & a_RegionX, int & a_RegionZ); + +protected: + friend class RegionLoader; + + + Chunk m_Chunks[32 * 32]; + + /** True iff the data for all the chunks has been loaded. + This doesn't mean that all the chunks are valid, only that the entire region has been processed and should + be displayed. */ + bool m_IsValid; +}; + + + + |