Cuberite
A lightweight, fast and extensible game server for Minecraft
ChunkDataCallback.h
Go to the documentation of this file.
1 
2 // ChunkDataCallback.h
3 
4 // Declares the cChunkDataCallback interface and several trivial descendants, for reading chunk data
5 
6 
7 
8 
9 
10 #pragma once
11 
12 #include "ChunkData.h"
13 
14 
15 
16 
17 
21 class cChunkDataCallback abstract
22 {
23 public:
24 
25  virtual ~cChunkDataCallback() {}
26 
30  virtual bool Coords(int a_ChunkX, int a_ChunkZ) { UNUSED(a_ChunkX); UNUSED(a_ChunkZ); return true; }
31 
33  virtual void LightIsValid(bool a_IsLightValid) { UNUSED(a_IsLightValid); }
34 
36  virtual void ChunkData(const ChunkBlockData & a_BlockData, const ChunkLightData & a_LightData) { UNUSED(a_BlockData); UNUSED(a_LightData); }
37 
39  virtual void HeightMap(const cChunkDef::HeightMap & a_HeightMap) { UNUSED(a_HeightMap); }
40 
42  virtual void BiomeMap(const cChunkDef::BiomeMap & a_BiomeMap) { UNUSED(a_BiomeMap); }
43 
45  virtual void Entity(cEntity * a_Entity) { UNUSED(a_Entity); }
46 
48  virtual void BlockEntity(cBlockEntity * a_Entity) { UNUSED(a_Entity); }
49 } ;
50 
51 
52 
53 
56  public cChunkDataCallback
57 {
58 public:
59 
62 
63 private:
64 
65  virtual void ChunkData(const ChunkBlockData & a_BlockData, const ChunkLightData & a_LightData) override
66  {
67  m_BlockData.Assign(a_BlockData);
68  m_LightData.Assign(a_LightData);
69  }
70 };
#define UNUSED
Definition: Globals.h:72
void Assign(const ChunkBlockData &a_Other)
Definition: ChunkData.cpp:172
void Assign(const ChunkLightData &a_Other)
Definition: ChunkData.cpp:202
A simple implementation of the cChunkDataCallback interface that just copies the cChunkData.
virtual void ChunkData(const ChunkBlockData &a_BlockData, const ChunkLightData &a_LightData) override
HEIGHTTYPE HeightMap[Width *Width]
The type used for any heightmap operations and storage; idx = x + Width * z; Height points to the hig...
Definition: ChunkDef.h:132
EMCSBiome BiomeMap[Width *Width]
The type used for any biomemap operations and storage inside Cuberite, using Cuberite biomes (need no...
Definition: ChunkDef.h:137
Definition: Entity.h:76