summaryrefslogtreecommitdiffstats
path: root/Tools/QtBiomeVisualiser/Region.h
blob: f1bef0c2debe57b0973363b56fae849935448a97 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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;
};