Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Types | Public Member Functions | Static Public Attributes | Private Attributes | List of all members
ChunkBlockData Class Reference

#include <ChunkData.h>

Collaboration diagram for ChunkBlockData:
Collaboration graph
[legend]

Public Types

using BlockArray = decltype(m_Blocks)::Type
 
using MetaArray = decltype(m_Metas)::Type
 
using SectionMetaType = NIBBLETYPE[SectionMetaCount]
 
using SectionType = BLOCKTYPE[SectionBlockCount]
 

Public Member Functions

void Assign (const ChunkBlockData &a_Other)
 
BLOCKTYPE GetBlock (Vector3i a_Position) const
 
NIBBLETYPE GetMeta (Vector3i a_Position) const
 
MetaArrayGetMetaSection (size_t a_Y) const
 
BlockArrayGetSection (size_t a_Y) const
 
void SetAll (const cChunkDef::BlockTypes &a_BlockSource, const cChunkDef::BlockNibbles &a_MetaSource)
 
void SetBlock (Vector3i a_Position, BLOCKTYPE a_Block)
 
void SetMeta (Vector3i a_Position, NIBBLETYPE a_Meta)
 
void SetSection (const SectionType &a_BlockSource, const SectionMetaType &a_MetaSource, size_t a_Y)
 

Static Public Attributes

static constexpr NIBBLETYPE DefaultMetaValue = 0x00
 
static constexpr BLOCKTYPE DefaultValue = 0x00
 
static constexpr size_t SectionBlockCount = cChunkDef::SectionHeight * cChunkDef::Width * cChunkDef::Width
 
static constexpr size_t SectionMetaCount = SectionBlockCount / 2
 

Private Attributes

ChunkDataStore< BLOCKTYPE, SectionBlockCount, DefaultValuem_Blocks
 
ChunkDataStore< NIBBLETYPE, SectionMetaCount, DefaultMetaValuem_Metas
 

Detailed Description

Definition at line 55 of file ChunkData.h.

Member Typedef Documentation

◆ BlockArray

using ChunkBlockData::BlockArray = decltype(m_Blocks)::Type

Definition at line 75 of file ChunkData.h.

◆ MetaArray

using ChunkBlockData::MetaArray = decltype(m_Metas)::Type

Definition at line 76 of file ChunkData.h.

◆ SectionMetaType

Definition at line 66 of file ChunkData.h.

◆ SectionType

Definition at line 65 of file ChunkData.h.

Member Function Documentation

◆ Assign()

void ChunkBlockData::Assign ( const ChunkBlockData a_Other)

Definition at line 172 of file ChunkData.cpp.

◆ GetBlock()

BLOCKTYPE ChunkBlockData::GetBlock ( Vector3i  a_Position) const
inline

Definition at line 80 of file ChunkData.h.

◆ GetMeta()

NIBBLETYPE ChunkBlockData::GetMeta ( Vector3i  a_Position) const
inline

Definition at line 81 of file ChunkData.h.

◆ GetMetaSection()

MetaArray* ChunkBlockData::GetMetaSection ( size_t  a_Y) const
inline

Definition at line 84 of file ChunkData.h.

◆ GetSection()

BlockArray* ChunkBlockData::GetSection ( size_t  a_Y) const
inline

Definition at line 83 of file ChunkData.h.

◆ SetAll()

void ChunkBlockData::SetAll ( const cChunkDef::BlockTypes a_BlockSource,
const cChunkDef::BlockNibbles a_MetaSource 
)

Definition at line 182 of file ChunkData.cpp.

◆ SetBlock()

void ChunkBlockData::SetBlock ( Vector3i  a_Position,
BLOCKTYPE  a_Block 
)
inline

Definition at line 86 of file ChunkData.h.

◆ SetMeta()

void ChunkBlockData::SetMeta ( Vector3i  a_Position,
NIBBLETYPE  a_Meta 
)
inline

Definition at line 87 of file ChunkData.h.

◆ SetSection()

void ChunkBlockData::SetSection ( const SectionType a_BlockSource,
const SectionMetaType a_MetaSource,
size_t  a_Y 
)

Definition at line 192 of file ChunkData.cpp.

Member Data Documentation

◆ DefaultMetaValue

constexpr NIBBLETYPE ChunkBlockData::DefaultMetaValue = 0x00
staticconstexpr

Definition at line 63 of file ChunkData.h.

◆ DefaultValue

constexpr BLOCKTYPE ChunkBlockData::DefaultValue = 0x00
staticconstexpr

Definition at line 62 of file ChunkData.h.

◆ m_Blocks

ChunkDataStore<BLOCKTYPE, SectionBlockCount, DefaultValue> ChunkBlockData::m_Blocks
private

Definition at line 70 of file ChunkData.h.

◆ m_Metas

ChunkDataStore<NIBBLETYPE, SectionMetaCount, DefaultMetaValue> ChunkBlockData::m_Metas
private

Definition at line 71 of file ChunkData.h.

◆ SectionBlockCount

constexpr size_t ChunkBlockData::SectionBlockCount = cChunkDef::SectionHeight * cChunkDef::Width * cChunkDef::Width
staticconstexpr

Definition at line 59 of file ChunkData.h.

◆ SectionMetaCount

constexpr size_t ChunkBlockData::SectionMetaCount = SectionBlockCount / 2
staticconstexpr

Definition at line 60 of file ChunkData.h.


The documentation for this class was generated from the following files: