Cuberite
A lightweight, fast and extensible game server for Minecraft
Classes | Macros
ChunkData.h File Reference
#include "FunctionRef.h"
#include "ChunkDef.h"
Include dependency graph for ChunkData.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ChunkBlockData
 
struct  ChunkDataStore< ElementType, ElementCount, DefaultValue >
 
class  ChunkLightData
 

Macros

#define ChunkDef_ForEachSection(BlockData, LightData, Callback)
 Invokes the callback functor for every chunk section containing at least one present block or light section data. More...
 

Macro Definition Documentation

◆ ChunkDef_ForEachSection

#define ChunkDef_ForEachSection (   BlockData,
  LightData,
  Callback 
)
Value:
do \
{ \
for (size_t Y = 0; Y < cChunkDef::NumSections; ++Y) \
{ \
const auto Blocks = BlockData.GetSection(Y); \
const auto Metas = BlockData.GetMetaSection(Y); \
const auto BlockLights = LightData.GetBlockLightSection(Y); \
const auto SkyLights = LightData.GetSkyLightSection(Y); \
if ((Blocks != nullptr) || (Metas != nullptr) || (BlockLights != nullptr) || (SkyLights != nullptr)) \
{ \
Callback \
} \
} \
} while (false)
static const size_t NumSections
Definition: ChunkDef.h:129

Invokes the callback functor for every chunk section containing at least one present block or light section data.

This is used to collect all data for all sections. In macro form to work around a Visual Studio 2017 ICE bug.

Definition at line 136 of file ChunkData.h.