rename chunk_inventories_map to ChunkInventoriesMap
This commit is contained in:
parent
ab53922474
commit
c7ca7e58b3
@ -117,7 +117,7 @@ void WorldRegions::put(
|
||||
}
|
||||
|
||||
static std::unique_ptr<ubyte[]> write_inventories(
|
||||
const chunk_inventories_map& inventories, uint32_t& datasize
|
||||
const ChunkInventoriesMap& inventories, uint32_t& datasize
|
||||
) {
|
||||
ByteBuilder builder;
|
||||
builder.putInt32(inventories.size());
|
||||
@ -135,8 +135,8 @@ static std::unique_ptr<ubyte[]> write_inventories(
|
||||
return data;
|
||||
}
|
||||
|
||||
static chunk_inventories_map load_inventories(const ubyte* src, uint32_t size) {
|
||||
chunk_inventories_map inventories;
|
||||
static ChunkInventoriesMap load_inventories(const ubyte* src, uint32_t size) {
|
||||
ChunkInventoriesMap inventories;
|
||||
ByteReader reader(src, size);
|
||||
auto count = reader.getInt32();
|
||||
for (int i = 0; i < count; i++) {
|
||||
@ -238,7 +238,7 @@ std::unique_ptr<light_t[]> WorldRegions::getLights(int x, int z) {
|
||||
return Lightmap::decode(data.get());
|
||||
}
|
||||
|
||||
chunk_inventories_map WorldRegions::fetchInventories(int x, int z) {
|
||||
ChunkInventoriesMap WorldRegions::fetchInventories(int x, int z) {
|
||||
uint32_t bytesSize;
|
||||
uint32_t srcSize;
|
||||
auto bytes = layers[REGION_LAYER_INVENTORIES].getData(x, z, bytesSize, srcSize);
|
||||
|
||||
@ -216,7 +216,7 @@ public:
|
||||
/// @return lights data or nullptr
|
||||
std::unique_ptr<light_t[]> getLights(int x, int z);
|
||||
|
||||
chunk_inventories_map fetchInventories(int x, int z);
|
||||
ChunkInventoriesMap fetchInventories(int x, int z);
|
||||
|
||||
BlocksMetadata getBlocksData(int x, int z);
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ void Chunk::removeBlockInventory(uint x, uint y, uint z) {
|
||||
}
|
||||
}
|
||||
|
||||
void Chunk::setBlockInventories(chunk_inventories_map map) {
|
||||
void Chunk::setBlockInventories(ChunkInventoriesMap map) {
|
||||
inventories = std::move(map);
|
||||
}
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ inline constexpr int CHUNK_DATA_LEN = CHUNK_VOL * 4;
|
||||
class ContentReport;
|
||||
class Inventory;
|
||||
|
||||
using chunk_inventories_map =
|
||||
using ChunkInventoriesMap =
|
||||
std::unordered_map<uint, std::shared_ptr<Inventory>>;
|
||||
|
||||
using BlocksMetadata = util::SmallHeap<uint16_t, uint8_t>;
|
||||
@ -38,7 +38,7 @@ public:
|
||||
} flags {};
|
||||
|
||||
/// @brief Block inventories map where key is index of block in voxels array
|
||||
chunk_inventories_map inventories;
|
||||
ChunkInventoriesMap inventories;
|
||||
/// @brief Blocks metadata heap
|
||||
BlocksMetadata blocksMetadata;
|
||||
|
||||
@ -57,7 +57,7 @@ public:
|
||||
std::shared_ptr<Inventory> inventory, uint x, uint y, uint z
|
||||
);
|
||||
void removeBlockInventory(uint x, uint y, uint z);
|
||||
void setBlockInventories(chunk_inventories_map map);
|
||||
void setBlockInventories(ChunkInventoriesMap map);
|
||||
|
||||
/// @return inventory bound to the given block or nullptr
|
||||
std::shared_ptr<Inventory> getBlockInventory(uint x, uint y, uint z) const;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user