Minetest  5.4.0
MapSector Class Reference

#include <mapsector.h>

+ Collaboration diagram for MapSector:

Public Member Functions

 MapSector (Map *parent, v2s16 pos, IGameDef *gamedef)
 
virtual ~MapSector ()
 
void deleteBlocks ()
 
v2s16 getPos ()
 
MapBlockgetBlockNoCreateNoEx (s16 y)
 
MapBlockcreateBlankBlockNoInsert (s16 y)
 
MapBlockcreateBlankBlock (s16 y)
 
void insertBlock (MapBlock *block)
 
void deleteBlock (MapBlock *block)
 
void getBlocks (MapBlockVect &dest)
 
bool empty () const
 
int size () const
 

Protected Member Functions

MapBlockgetBlockBuffered (s16 y)
 

Protected Attributes

std::unordered_map< s16, MapBlock * > m_blocks
 
Mapm_parent
 
v2s16 m_pos
 
IGameDefm_gamedef
 
MapBlockm_block_cache = nullptr
 
s16 m_block_cache_y
 

Constructor & Destructor Documentation

◆ MapSector()

MapSector::MapSector ( Map parent,
v2s16  pos,
IGameDef gamedef 
)

◆ ~MapSector()

MapSector::~MapSector ( )
virtual

References deleteBlocks().

+ Here is the call graph for this function:

Member Function Documentation

◆ createBlankBlock()

MapBlock * MapSector::createBlankBlock ( s16  y)

References createBlankBlockNoInsert(), and m_blocks.

Referenced by ServerMap::createBlock(), and ServerMap::emergeBlock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createBlankBlockNoInsert()

MapBlock * MapSector::createBlankBlockNoInsert ( s16  y)

References getBlockBuffered(), m_gamedef, m_parent, and m_pos.

Referenced by createBlankBlock(), and ServerMap::loadBlock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteBlock()

void MapSector::deleteBlock ( MapBlock block)

References MapBlock::getPos(), m_block_cache, and m_blocks.

Referenced by ServerMap::deleteBlock(), and Map::timerUpdate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteBlocks()

void MapSector::deleteBlocks ( )

References m_block_cache, and m_blocks.

Referenced by ~MapSector().

+ Here is the caller graph for this function:

◆ empty()

bool MapSector::empty ( ) const
inline

References m_blocks.

◆ getBlockBuffered()

MapBlock * MapSector::getBlockBuffered ( s16  y)
protected

References m_block_cache, m_block_cache_y, and m_blocks.

Referenced by createBlankBlockNoInsert(), getBlockNoCreateNoEx(), and insertBlock().

+ Here is the caller graph for this function:

◆ getBlockNoCreateNoEx()

MapBlock * MapSector::getBlockNoCreateNoEx ( s16  y)

References getBlockBuffered().

Referenced by ServerMap::createBlock(), Map::getBlockNoCreateNoEx(), Client::handleCommand_BlockData(), and ServerMap::loadBlock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBlocks()

void MapSector::getBlocks ( MapBlockVect dest)

References m_blocks.

Referenced by ServerMap::listAllLoadedBlocks(), ServerMap::save(), Map::timerUpdate(), and ClientMap::updateDrawList().

+ Here is the caller graph for this function:

◆ getPos()

v2s16 MapSector::getPos ( )
inline

References m_pos.

Referenced by Client::handleCommand_BlockData(), and ClientMap::updateDrawList().

+ Here is the caller graph for this function:

◆ insertBlock()

void MapSector::insertBlock ( MapBlock block)

References getBlockBuffered(), MapBlock::getPos(), m_blocks, and m_pos.

Referenced by Client::handleCommand_BlockData(), and ServerMap::loadBlock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ size()

int MapSector::size ( ) const
inline

References m_blocks.

Referenced by ClientMap::updateDrawList().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_block_cache

MapBlock* MapSector::m_block_cache = nullptr
protected

◆ m_block_cache_y

s16 MapSector::m_block_cache_y
protected

Referenced by getBlockBuffered().

◆ m_blocks

std::unordered_map<s16, MapBlock*> MapSector::m_blocks
protected

◆ m_gamedef

IGameDef* MapSector::m_gamedef
protected

◆ m_parent

Map* MapSector::m_parent
protected

◆ m_pos

v2s16 MapSector::m_pos
protected

The documentation for this class was generated from the following files: