summaryrefslogtreecommitdiffstats
path: root/Tools/QtBiomeVisualiser/Region.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-10-27 23:58:09 +0100
committerMattes D <github@xoft.cz>2014-10-27 23:58:09 +0100
commitc53b7e5d38c24bce7ba55abf3060ffd012783086 (patch)
treee592eeadadbd41cede746f8729bd70c275552eb5 /Tools/QtBiomeVisualiser/Region.h
parentFixed typo. (diff)
downloadcuberite-c53b7e5d38c24bce7ba55abf3060ffd012783086.tar
cuberite-c53b7e5d38c24bce7ba55abf3060ffd012783086.tar.gz
cuberite-c53b7e5d38c24bce7ba55abf3060ffd012783086.tar.bz2
cuberite-c53b7e5d38c24bce7ba55abf3060ffd012783086.tar.lz
cuberite-c53b7e5d38c24bce7ba55abf3060ffd012783086.tar.xz
cuberite-c53b7e5d38c24bce7ba55abf3060ffd012783086.tar.zst
cuberite-c53b7e5d38c24bce7ba55abf3060ffd012783086.zip
Diffstat (limited to '')
-rw-r--r--Tools/QtBiomeVisualiser/Region.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/Tools/QtBiomeVisualiser/Region.h b/Tools/QtBiomeVisualiser/Region.h
new file mode 100644
index 000000000..f1bef0c2d
--- /dev/null
+++ b/Tools/QtBiomeVisualiser/Region.h
@@ -0,0 +1,44 @@
+#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:
+
+ 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;
+};
+
+
+
+