|
Lodestone.Level
|
#include <Chunk.h>


Public Member Functions | |
| Chunk () | |
| std::string | toString () const override |
| Chunk (const coords::ChunkCoordinates &coords, ChunkContainer *container=nullptr) | |
| ~Chunk () override | |
| virtual void | calculateHeightmap ()=0 |
| virtual void | calculateHeightmapAtColumn (int localX, int localZ, int height)=0 |
| virtual int | getChunkHeight () const =0 |
| Gets the height of the chunk in Sections, can be used for getting section count. | |
| int | getChunkBlockHeight () const |
| Gets the height of the chunk in Blocks. | |
| virtual section::Section * | getSection (const coords::SectionCoordinates §ionY) const =0 |
| virtual section::Section * | getSectionCreate (const coords::SectionCoordinates §ionY)=0 |
| virtual section::Section * | getSectionFromBlockY (const signed_size_t &blockY) const |
| virtual section::Section * | getSectionFromBlockYCreate (const signed_size_t &blockY) |
| virtual const int16_t * | getHeightmap () const |
| virtual const block::instance::BlockInstance & | getBlock (int localX, int y, int localZ) const =0 |
| virtual void | setBlock (block::instance::BlockInstance &&block, int localX, int y, int localZ)=0 |
| Sets a block at the given X, Y, and Z coordinates. | |
| virtual void | setBlockRaw (block::instance::BlockInstance &&block, int localX, int y, int localZ)=0 |
| Sets a block at the given X, Y, and Z coordinates. | |
| virtual int16_t | getHeightAt (int localX, int localZ) const |
| virtual void | setHeightAt (int16_t height, int localX, int localZ) |
| virtual const block::instance::BlockInstance & | getBlockAtHeight (int localX, int localZ) const |
| virtual void | setBlockAtHeight (block::instance::BlockInstance &&block, int localX, int localZ) |
| bool | hasCoords () const |
| const std::optional< coords::ChunkCoordinates > & | getCoords () const |
| void | setCoords (const std::optional< coords::ChunkCoordinates > &coords) |
| void | invalidateCoords () |
| void | attach (ChunkContainer *container) |
| void | attach (ChunkContainer *container, const coords::ChunkCoordinates &coords) |
| void | detach (bool shouldInvalidateCoords) |
| bool | isInContainer () const |
| ChunkContainer * | getContainer () const |
| virtual int | getSectionCount () const =0 |
| virtual void | postProcess () |
| Public Member Functions inherited from lodestone::common::string::StringSerializable | |
| constexpr | StringSerializable ()=default |
| virtual constexpr | ~StringSerializable ()=default |
| Public Member Functions inherited from lodestone::level::properties::ReflectiveProperties | |
| virtual | ~ReflectiveProperties ()=default |
| virtual std::unique_ptr< AbstractProperty > | getProperty (const std::string &name) |
| template<typename T> | |
| std::unique_ptr< TemplatedProperty< T > > | getProperty (const std::string &name) |
| template<typename T> | |
| std::unique_ptr< TemplatedProperty< T > > | getPropertyOr (const std::string &name, T value) |
| Public Member Functions inherited from lodestone::common::util::IHasDerivedTypes< ChunkType > | |
| constexpr | IHasDerivedTypes ()=default |
| virtual constexpr | ~IHasDerivedTypes ()=default |
| virtual constexpr EType | type ()=0 |
| bool constexpr | instanceOf (EType type) |
Static Public Attributes | |
| static constexpr int | TOTAL_CHUNK_2D_SIZE = common::constants::CHUNK_WIDTH * common::constants::CHUNK_DEPTH |
Protected Attributes | |
| std::optional< coords::ChunkCoordinates > | m_coords |
| ChunkContainer * | m_container |
| The parent container which may hold the chunk. | |
| int16_t * | m_heightMap = new int16_t[TOTAL_CHUNK_2D_SIZE] {} |
| Heightmap. | |
| lodestone::level::chunk::Chunk::Chunk | ( | ) |
| lodestone::level::chunk::Chunk::Chunk | ( | const coords::ChunkCoordinates & | coords, |
| ChunkContainer * | container = nullptr ) |
|
override |
| void lodestone::level::chunk::Chunk::attach | ( | ChunkContainer * | container | ) |
| void lodestone::level::chunk::Chunk::attach | ( | ChunkContainer * | container, |
| const coords::ChunkCoordinates & | coords ) |
|
pure virtual |
Implemented in lodestone::level::chunk::ImmutableChunk, and lodestone::level::chunk::LevelChunk.
|
pure virtual |
Implemented in lodestone::level::chunk::ImmutableChunk, and lodestone::level::chunk::LevelChunk.
| void lodestone::level::chunk::Chunk::detach | ( | bool | shouldInvalidateCoords | ) |
|
pure virtual |
Implemented in lodestone::level::chunk::ImmutableChunk, and lodestone::level::chunk::LevelChunk.
|
virtual |
Reimplemented in lodestone::level::chunk::ImmutableChunk.
| int lodestone::level::chunk::Chunk::getChunkBlockHeight | ( | ) | const |
Gets the height of the chunk in Blocks.
|
pure virtual |
Gets the height of the chunk in Sections, can be used for getting section count.
Implemented in lodestone::level::chunk::ImmutableChunk, and lodestone::level::chunk::LevelChunk.
| ChunkContainer * lodestone::level::chunk::Chunk::getContainer | ( | ) | const |
| const std::optional< coords::ChunkCoordinates > & lodestone::level::chunk::Chunk::getCoords | ( | ) | const |
|
virtual |
Reimplemented in lodestone::level::chunk::ImmutableChunk.
|
virtual |
|
pure virtual |
Implemented in lodestone::level::chunk::ImmutableChunk, and lodestone::level::chunk::LevelChunk.
|
pure virtual |
Implemented in lodestone::level::chunk::ImmutableChunk, and lodestone::level::chunk::LevelChunk.
|
pure virtual |
Implemented in lodestone::level::chunk::ImmutableChunk, and lodestone::level::chunk::LevelChunk.
|
virtual |
|
virtual |
| bool lodestone::level::chunk::Chunk::hasCoords | ( | ) | const |
| void lodestone::level::chunk::Chunk::invalidateCoords | ( | ) |
| bool lodestone::level::chunk::Chunk::isInContainer | ( | ) | const |
|
virtual |
|
pure virtual |
Sets a block at the given X, Y, and Z coordinates.
Also updates the blockmap and heightmap
Implemented in lodestone::level::chunk::ImmutableChunk, and lodestone::level::chunk::LevelChunk.
|
virtual |
Reimplemented in lodestone::level::chunk::ImmutableChunk.
|
pure virtual |
Sets a block at the given X, Y, and Z coordinates.
Does not update blockmap
Implemented in lodestone::level::chunk::ImmutableChunk, and lodestone::level::chunk::LevelChunk.
| void lodestone::level::chunk::Chunk::setCoords | ( | const std::optional< coords::ChunkCoordinates > & | coords | ) |
|
virtual |
Reimplemented in lodestone::level::chunk::ImmutableChunk.
|
inlineoverridevirtual |
Implements lodestone::common::string::StringSerializable.
|
protected |
The parent container which may hold the chunk.
|
protected |
|
protected |
Heightmap.
Each x and z coord corresponds to the Y coordinate above the topmost block(height)
|
staticconstexpr |