summaryrefslogtreecommitdiffstats
path: root/Tools/QtBiomeVisualiser/ChunkSource.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-09-14 14:16:17 +0200
committerHowaner <franzi.moos@googlemail.com>2014-09-14 14:16:17 +0200
commit92e7e5c615efb591210ffd978afa012027f2c84f (patch)
tree1271b2281ab938f59f3f2d933a6c873fd3f633ba /Tools/QtBiomeVisualiser/ChunkSource.h
parent1.8: Updated scoreboard packets. (diff)
parentAdded new Qt-based biome visualiser. (diff)
downloadcuberite-92e7e5c615efb591210ffd978afa012027f2c84f.tar
cuberite-92e7e5c615efb591210ffd978afa012027f2c84f.tar.gz
cuberite-92e7e5c615efb591210ffd978afa012027f2c84f.tar.bz2
cuberite-92e7e5c615efb591210ffd978afa012027f2c84f.tar.lz
cuberite-92e7e5c615efb591210ffd978afa012027f2c84f.tar.xz
cuberite-92e7e5c615efb591210ffd978afa012027f2c84f.tar.zst
cuberite-92e7e5c615efb591210ffd978afa012027f2c84f.zip
Diffstat (limited to 'Tools/QtBiomeVisualiser/ChunkSource.h')
-rw-r--r--Tools/QtBiomeVisualiser/ChunkSource.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/Tools/QtBiomeVisualiser/ChunkSource.h b/Tools/QtBiomeVisualiser/ChunkSource.h
new file mode 100644
index 000000000..d6eb2e3cb
--- /dev/null
+++ b/Tools/QtBiomeVisualiser/ChunkSource.h
@@ -0,0 +1,60 @@
+#pragma once
+#include "Chunk.h"
+
+
+
+
+
+// fwd:
+class cBiomeGen;
+
+
+
+
+
+/** Abstract interface for getting biome data for chunks. */
+class ChunkSource
+{
+public:
+ virtual ~ChunkSource() {}
+
+ /** Fills the a_DestChunk with the biomes for the specified coords.
+ It is expected to be thread-safe and re-entrant. Usually QThread::idealThreadCount() threads are used. */
+ virtual void getChunkBiomes(int a_ChunkX, int a_ChunkZ, ChunkPtr a_DestChunk) = 0;
+};
+
+
+
+
+
+
+class BioGenSource :
+ public ChunkSource
+{
+public:
+ /** Constructs a new BioGenSource based on the biome generator given.
+ Takes ownership of a_BiomeGen */
+ BioGenSource(cBiomeGen * a_BiomeGen);
+
+ virtual void getChunkBiomes(int a_ChunkX, int a_ChunkZ, ChunkPtr a_DestChunk) override;
+
+protected:
+ std::shared_ptr<cBiomeGen> m_BiomeGen;
+ QMutex m_Mtx;
+};
+
+
+
+
+class AnvilSource :
+ public ChunkSource
+{
+public:
+ // TODO
+
+ virtual void getChunkBiomes(int a_ChunkX, int a_ChunkZ, ChunkPtr a_DestChunk) override;
+};
+
+
+
+