|
Lodestone.Level
|
Holds chunks. More...
#include <ChunkContainer.h>


Public Member Functions | |
| ~ChunkContainer () override=default | |
| ChunkContainer ()=default | |
| ChunkContainer (ChunkContainer &&)=default | |
| ChunkContainer & | operator= (ChunkContainer &&)=default |
| std::string | toString () const override |
| virtual bool | isChunkInBounds (const coords::ChunkCoordinates &coords)=0 |
| bool | hasChunk (const coords::ChunkCoordinates &coords) const |
| Returns true if chunk at coords exist. | |
| bool | hasChunk (const int x, const int z) const |
| Returns true if chunk at coords exist. | |
| Chunk * | createChunk (const coords::ChunkCoordinates &coords, int height=256) |
| Creates a chunk at the given coordinates with the given height. | |
| Chunk * | createChunk (const int x, const int z, const int height=256) |
| Creates a chunk at the given coordinates with the given height. | |
| void | addChunk (std::unique_ptr< Chunk > chunk) |
| void | addChunk (const coords::ChunkCoordinates &coords, std::unique_ptr< Chunk > chunk) |
| void | addChunk (const int x, const int z, std::unique_ptr< Chunk > chunk) |
| Chunk * | getChunk (const coords::ChunkCoordinates &coords) |
| Chunk * | getChunk (const int x, const int z) |
| Chunk * | getChunkFromBlockCoords (const signed_size_t blockX, const signed_size_t blockZ) |
| Chunk * | getChunkCreate (const coords::ChunkCoordinates &coords, int height=256) |
| Chunk * | getChunkCreate (const int x, const int z, const int height=256) |
| Chunk * | getChunkFromBlockCoordsCreate (const int blockX, const int blockZ, const int height=256) |
| const Chunk * | getChunk (const coords::ChunkCoordinates &coords) const |
| const Chunk * | getChunk (const int x, const int z) const |
| const Chunk * | getChunkFromBlockCoords (const signed_size_t blockX, const signed_size_t blockZ) const |
| std::unique_ptr< Chunk > | detachChunk (const coords::ChunkCoordinates &coords, bool shouldInvalidateCoords=true) |
| std::unique_ptr< Chunk > | detachChunk (const int x, const int z, const bool shouldInvalidateCoords=true) |
| void | removeChunk (const coords::ChunkCoordinates &coords) |
| void | removeChunk (const int x, const int z) |
| void | merge (std::unique_ptr< ChunkContainer > rhs) |
| map_t< coords::ChunkCoordinates, std::unique_ptr< Chunk > > & | getChunks () |
| const map_t< coords::ChunkCoordinates, std::unique_ptr< Chunk > > & | getChunks () const |
| types::Bounds3i | getChunkBounds () const |
| ChunkContainer (const ChunkContainer &)=delete | |
| ChunkContainer & | operator= (const ChunkContainer &)=delete |
| Public Member Functions inherited from lodestone::common::string::StringSerializable | |
| constexpr | StringSerializable ()=default |
| virtual constexpr | ~StringSerializable ()=default |
Protected Attributes | |
| map_t< coords::ChunkCoordinates, std::unique_ptr< Chunk > > | m_chunks |
Holds chunks.
|
overridedefault |
|
default |
|
default |
|
delete |
| void lodestone::level::chunk::ChunkContainer::addChunk | ( | const coords::ChunkCoordinates & | coords, |
| std::unique_ptr< Chunk > | chunk ) |
|
inline |
| void lodestone::level::chunk::ChunkContainer::addChunk | ( | std::unique_ptr< Chunk > | chunk | ) |
| chunk::Chunk * lodestone::level::chunk::ChunkContainer::createChunk | ( | const coords::ChunkCoordinates & | coords, |
| int | height = 256 ) |
Creates a chunk at the given coordinates with the given height.
| coords | The coordinates you want to create a chunk at |
| height | The height you'd like to make the new chunk |
|
inline |
Creates a chunk at the given coordinates with the given height.
| x | The x coordinate you want to create a chunk at |
| z | The z coordinate you want to create a chunk at |
| height | The height you'd like to make the new chunk |
| std::unique_ptr< chunk::Chunk > lodestone::level::chunk::ChunkContainer::detachChunk | ( | const coords::ChunkCoordinates & | coords, |
| bool | shouldInvalidateCoords = true ) |
|
inline |
| chunk::Chunk * lodestone::level::chunk::ChunkContainer::getChunk | ( | const coords::ChunkCoordinates & | coords | ) |
| const chunk::Chunk * lodestone::level::chunk::ChunkContainer::getChunk | ( | const coords::ChunkCoordinates & | coords | ) | const |
|
inline |
|
inline |
| types::Bounds3i lodestone::level::chunk::ChunkContainer::getChunkBounds | ( | ) | const |
| chunk::Chunk * lodestone::level::chunk::ChunkContainer::getChunkCreate | ( | const coords::ChunkCoordinates & | coords, |
| int | height = 256 ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| bool lodestone::level::chunk::ChunkContainer::hasChunk | ( | const coords::ChunkCoordinates & | coords | ) | const |
Returns true if chunk at coords exist.
| coords | The coordinates you want to check for a chunk |
true if a chunk at given coords exist
|
inline |
Returns true if chunk at coords exist.
| x | The X coordinate you want to check for a chunk |
| z | The Z coordinate you want to check for a chunk |
true if a chunk at given coords exist
|
pure virtual |
Implemented in lodestone::level::FiniteLevel, and lodestone::level::Level.
| void lodestone::level::chunk::ChunkContainer::merge | ( | std::unique_ptr< ChunkContainer > | rhs | ) |
|
default |
|
delete |
| void lodestone::level::chunk::ChunkContainer::removeChunk | ( | const coords::ChunkCoordinates & | coords | ) |
|
inline |
|
inlineoverridevirtual |
Implements lodestone::common::string::StringSerializable.
|
protected |