Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <ChunkData.h>
Public Types | |
using | Type = std::array< ElementType, ElementCount > |
Public Member Functions | |
void | Assign (const ChunkDataStore< ElementType, ElementCount, DefaultValue > &a_Other) |
Copy assign from another ChunkDataStore. More... | |
ElementType | Get (Vector3i a_Position) const |
Gets one value at the given position. More... | |
Type * | GetSection (size_t a_Y) const |
Returns a raw pointer to the internal representation of the specified section. More... | |
void | Set (Vector3i a_Position, ElementType a_Value) |
Sets one value at the given position. More... | |
void | SetAll (const ElementType(&a_Source)[cChunkDef::NumSections *ElementCount]) |
Copies the data from the specified flat array into the internal representation. More... | |
void | SetSection (const ElementType(&a_Source)[ElementCount], size_t a_Y) |
Copies the data from the specified flat section array into the internal representation. More... | |
Public Attributes | |
std::unique_ptr< Type > | Store [cChunkDef::NumSections] |
Contains all the sections this ChunkDataStore manages. More... | |
Definition at line 20 of file ChunkData.h.
using ChunkDataStore< ElementType, ElementCount, DefaultValue >::Type = std::array<ElementType, ElementCount> |
Definition at line 22 of file ChunkData.h.
void ChunkDataStore< ElementType, ElementCount, DefaultValue >::Assign | ( | const ChunkDataStore< ElementType, ElementCount, DefaultValue > & | a_Other | ) |
Copy assign from another ChunkDataStore.
Definition at line 55 of file ChunkData.cpp.
ElementType ChunkDataStore< ElementType, ElementCount, DefaultValue >::Get | ( | Vector3i | a_Position | ) | const |
Gets one value at the given position.
Returns DefaultValue if the section is not allocated.
Definition at line 73 of file ChunkData.cpp.
ChunkDataStore< ElementType, ElementCount, DefaultValue >::Type * ChunkDataStore< ElementType, ElementCount, DefaultValue >::GetSection | ( | size_t | a_Y | ) | const |
Returns a raw pointer to the internal representation of the specified section.
Will be nullptr if the section is not allocated.
Definition at line 98 of file ChunkData.cpp.
void ChunkDataStore< ElementType, ElementCount, DefaultValue >::Set | ( | Vector3i | a_Position, |
ElementType | a_Value | ||
) |
Sets one value at the given position.
Allocates a section if needed for the operation.
Definition at line 108 of file ChunkData.cpp.
void ChunkDataStore< ElementType, ElementCount, DefaultValue >::SetAll | ( | const ElementType(&) | a_Source[cChunkDef::NumSections *ElementCount] | ) |
Copies the data from the specified flat array into the internal representation.
Allocates sections that are needed for the operation.
Definition at line 160 of file ChunkData.cpp.
void ChunkDataStore< ElementType, ElementCount, DefaultValue >::SetSection | ( | const ElementType(&) | a_Source[ElementCount], |
size_t | a_Y | ||
) |
Copies the data from the specified flat section array into the internal representation.
Allocates a section if needed for the operation.
Definition at line 139 of file ChunkData.cpp.
std::unique_ptr<Type> ChunkDataStore< ElementType, ElementCount, DefaultValue >::Store[cChunkDef::NumSections] |
Contains all the sections this ChunkDataStore manages.
Definition at line 48 of file ChunkData.h.