2014-09-13 19:32:00 -04:00
|
|
|
#include "Globals.h"
|
2014-09-24 05:21:59 -04:00
|
|
|
#include "QtChunk.h"
|
2014-09-13 19:32:00 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Chunk::Chunk() :
|
|
|
|
m_IsValid(false)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-03 13:41:42 -04:00
|
|
|
void Chunk::setBiomes(const cChunkDef::BiomeMap & a_Biomes)
|
2014-09-13 19:32:00 -04:00
|
|
|
{
|
2014-10-28 15:52:04 -04:00
|
|
|
for (size_t idx = 0; idx < ARRAYCOUNT(a_Biomes); ++idx)
|
|
|
|
{
|
|
|
|
m_Biomes[idx] = static_cast<short>(a_Biomes[idx]);
|
|
|
|
}
|
2014-09-13 19:32:00 -04:00
|
|
|
m_IsValid = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-03 13:41:42 -04:00
|
|
|
|
|
|
|
EMCSBiome Chunk::getBiome(int a_RelX, int a_RelZ)
|
|
|
|
{
|
|
|
|
if (!m_IsValid)
|
|
|
|
{
|
|
|
|
return biInvalidBiome;
|
|
|
|
}
|
2014-10-28 15:52:04 -04:00
|
|
|
return static_cast<EMCSBiome>(m_Biomes[a_RelX + 16 * a_RelZ]);
|
2014-10-03 13:41:42 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|