Interface for chunk data representation.
More...
#include <IChunkData.h>
|
|
| IChunkData (glm::ivec3 dims) |
| |
| void | serialize (std::ostream &out) const override=0 |
| |
| void | deserialize (std::istream &in) override=0 |
| |
| virtual BlockID | getBlock (const glm::ivec3 &pos) const =0 |
| |
|
virtual MultiBlock * | getMultiBlock (const glm::ivec3 &pos)=0 |
| |
|
virtual void | setBlock (const glm::ivec3 &pos, BlockID block)=0 |
| |
|
virtual void | setBlock (const glm::ivec3 &pos, BlockID block, BlockState state)=0 |
| |
|
virtual void | setMultiBlock (const glm::ivec3 &pos, MultiBlock &&multiBlock)=0 |
| |
| virtual BlockState * | getState (const glm::ivec3 &pos)=0 |
| |
|
virtual const BlockState * | getState (const glm::ivec3 &pos) const =0 |
| |
|
virtual BlockState * | getOrCreateState (const glm::ivec3 &pos)=0 |
| |
|
virtual void | setState (const glm::ivec3 &pos, BlockState &&state)=0 |
| |
|
virtual void | clearState (const glm::ivec3 &pos)=0 |
| |
| void | clear (const glm::ivec3 &pos) |
| |
|
bool | isEmpty (const glm::ivec3 &pos) const |
| |
|
BlockID | getBlockAndState (const glm::ivec3 &pos, BlockState *&state) |
| |
|
BlockID | getBlockAndState (const glm::ivec3 &pos, const BlockState *&state) const |
| |
|
BlockID | getAll (const glm::ivec3 &pos, BlockState *&state, MultiBlock *&multiBlock) |
| |
|
|
glm::ivec3 | dims |
| |
|
bool | populated = false |
| |
Interface for chunk data representation.
- Note
- The concrete implementation must represent the whole chunk range, from (0, 0, 0) to (dims.x - 1, dims.y - 1, dims.z - 1).
-
For representing invalid blockID use InvalidBlockID from Globals.h
◆ clear()
| void engine::IChunkData::clear |
( |
const glm::ivec3 & |
pos | ) |
|
|
inline |
◆ deserialize()
| void engine::IChunkData::deserialize |
( |
std::istream & |
in | ) |
|
|
overridepure virtual |
◆ getBlock()
| virtual BlockID engine::IChunkData::getBlock |
( |
const glm::ivec3 & |
pos | ) |
const |
|
pure virtual |
◆ getState()
| virtual BlockState * engine::IChunkData::getState |
( |
const glm::ivec3 & |
pos | ) |
|
|
pure virtual |
◆ serialize()
| void engine::IChunkData::serialize |
( |
std::ostream & |
out | ) |
const |
|
overridepure virtual |
The documentation for this class was generated from the following file: