#include <mapsector.h>
Public Member Functions | |
MapSector (Map *parent, v2s16 pos, IGameDef *gamedef) | |
virtual | ~MapSector () |
void | deleteBlocks () |
v2s16 | getPos () const |
MapBlock * | getBlockNoCreateNoEx (s16 y) |
std::unique_ptr< MapBlock > | createBlankBlockNoInsert (s16 y) |
MapBlock * | createBlankBlock (s16 y) |
void | insertBlock (std::unique_ptr< MapBlock > block) |
void | deleteBlock (MapBlock *block) |
std::unique_ptr< MapBlock > | detachBlock (MapBlock *block) |
void | getBlocks (MapBlockVect &dest) |
const auto & | getBlocks () const |
const auto & | getBlocks ()=delete |
bool | empty () const |
int | size () const |
Protected Member Functions | |
MapBlock * | getBlockBuffered (s16 y) |
Protected Attributes | |
std::unordered_map< s16, std::unique_ptr< MapBlock > > | m_blocks |
Map * | m_parent |
v2s16 | m_pos |
IGameDef * | m_gamedef |
MapBlock * | m_block_cache = nullptr |
s16 | m_block_cache_y |
|
virtual |
MapBlock * MapSector::createBlankBlock | ( | s16 | y | ) |
References createBlankBlockNoInsert(), and m_blocks.
Referenced by DummyMap::DummyMap(), ServerMap::createBlock(), ServerMap::emergeBlock(), Client::handleCommand_BlockData(), and Client::step().
std::unique_ptr< MapBlock > MapSector::createBlankBlockNoInsert | ( | s16 | y | ) |
References blockpos_over_max_limit(), getBlockBuffered(), m_gamedef, and m_pos.
Referenced by createBlankBlock(), and ServerMap::loadBlock().
void MapSector::deleteBlock | ( | MapBlock * | block | ) |
References detachBlock().
Referenced by Map::timerUpdate().
void MapSector::deleteBlocks | ( | ) |
References m_block_cache, and m_blocks.
Referenced by ~MapSector().
References MapBlock::getPos(), m_block_cache, m_blocks, and MapBlock::makeOrphan().
Referenced by deleteBlock(), and ServerMap::deleteBlock().
|
inline |
References m_blocks.
|
protected |
References m_block_cache, m_block_cache_y, and m_blocks.
Referenced by createBlankBlockNoInsert(), getBlockNoCreateNoEx(), and insertBlock().
MapBlock * MapSector::getBlockNoCreateNoEx | ( | s16 | y | ) |
References getBlockBuffered().
Referenced by ServerMap::createBlock(), Map::getBlockNoCreateNoEx(), Client::handleCommand_BlockData(), ServerMap::loadBlock(), Client::step(), and ClientMap::updateDrawList().
|
inline |
References m_blocks.
|
delete |
void MapSector::getBlocks | ( | MapBlockVect & | dest | ) |
References m_blocks.
Referenced by ServerMap::listAllLoadedBlocks(), ServerMap::save(), Map::timerUpdate(), ClientMap::touchMapBlocks(), ClientMap::updateDrawList(), and ClientMap::updateDrawListShadow().
|
inline |
References m_pos.
Referenced by Client::handleCommand_BlockData(), ClientMap::touchMapBlocks(), and ClientMap::updateDrawList().
void MapSector::insertBlock | ( | std::unique_ptr< MapBlock > | block | ) |
References getBlockBuffered(), m_blocks, and m_pos.
Referenced by ServerMap::loadBlock().
|
inline |
References m_blocks.
Referenced by ClientMap::touchMapBlocks(), ClientMap::updateDrawList(), and ClientMap::updateDrawListShadow().
|
protected |
Referenced by deleteBlocks(), detachBlock(), and getBlockBuffered().
|
protected |
Referenced by getBlockBuffered().
|
protected |
Referenced by createBlankBlock(), deleteBlocks(), detachBlock(), empty(), getBlockBuffered(), getBlocks(), getBlocks(), insertBlock(), and size().
|
protected |
Referenced by createBlankBlockNoInsert().
|
protected |
|
protected |
Referenced by createBlankBlockNoInsert(), getPos(), and insertBlock().