Luanti 5.15.0-dev
 
Loading...
Searching...
No Matches
LBMManager Class Reference

#include <blockmodifier.h>

+ Collaboration diagram for LBMManager:

Public Types

typedef std::map< u32, LBMContentMappinglbm_lookup_map
 

Public Member Functions

 LBMManager ()=default
 
 ~LBMManager ()
 
void addLBMDef (LoadingBlockModifierDef *lbm_def)
 
void loadIntroductionTimes (const std::string &times, IGameDef *gamedef, u32 now)
 
std::string createIntroductionTimesString ()
 
void applyLBMs (ServerEnvironment *env, MapBlock *block, u32 stamp, float dtime_s)
 

Private Member Functions

lbm_lookup_map::const_iterator getLBMsIntroducedAfter (u32 time)
 

Static Private Member Functions

static std::unordered_map< std::string, u32 > parseIntroductionTimesString (const std::string &times)
 

Private Attributes

bool m_query_mode = false
 
std::unordered_map< std::string, LoadingBlockModifierDef * > m_lbm_defs
 
lbm_lookup_map m_lbm_lookup
 

Member Typedef Documentation

◆ lbm_lookup_map

Constructor & Destructor Documentation

◆ LBMManager()

LBMManager::LBMManager ( )
default

◆ ~LBMManager()

LBMManager::~LBMManager ( )

References m_lbm_defs, and m_lbm_lookup.

Member Function Documentation

◆ addLBMDef()

void LBMManager::addLBMDef ( LoadingBlockModifierDef * lbm_def)

References FATAL_ERROR_IF, LBM_NAME_ALLOWED_CHARS, m_lbm_defs, m_query_mode, LoadingBlockModifierDef::name, str_starts_with(), and string_allowed().

Referenced by ServerEnvironment::addLoadingBlockModifierDef(), TestLBMManager::testExisting(), and TestLBMManager::testNew().

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

◆ applyLBMs()

void LBMManager::applyLBMs ( ServerEnvironment * env,
MapBlock * block,
u32 stamp,
float dtime_s )

References CONTENT_IGNORE, FATAL_ERROR_IF, NodeDefManager::get(), MapNode::getContent(), ServerEnvironment::getGameDef(), getLBMsIntroducedAfter(), MapBlock::getNodeNoCheck(), MapBlock::getPos(), MapBlock::isOrphan(), m_lbm_lookup, m_query_mode, MAP_BLOCKSIZE, ContentFeatures::name, IGameDef::ndef(), and tracestream.

Referenced by ServerEnvironment::activateBlock().

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

◆ createIntroductionTimesString()

std::string LBMManager::createIntroductionTimesString ( )

References FATAL_ERROR_IF, m_lbm_lookup, and m_query_mode.

Referenced by ServerEnvironment::saveMeta(), TestLBMManager::testDiscard(), TestLBMManager::testExisting(), and TestLBMManager::testNew().

+ Here is the caller graph for this function:

◆ getLBMsIntroducedAfter()

lbm_lookup_map::const_iterator LBMManager::getLBMsIntroducedAfter ( u32 time)
inlineprivate

References m_lbm_lookup.

Referenced by applyLBMs().

+ Here is the caller graph for this function:

◆ loadIntroductionTimes()

void LBMManager::loadIntroductionTimes ( const std::string & times,
IGameDef * gamedef,
u32 now )
Parameters
nowcurrent game time

References infostream, m_lbm_defs, m_lbm_lookup, m_query_mode, parseIntroductionTimesString(), U32_MAX, and warningstream.

Referenced by ServerEnvironment::loadDefaultMeta(), ServerEnvironment::loadMeta(), TestLBMManager::testDiscard(), TestLBMManager::testExisting(), and TestLBMManager::testNew().

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

◆ parseIntroductionTimesString()

std::unordered_map< std::string, u32 > LBMManager::parseIntroductionTimesString ( const std::string & times)
staticprivate
Returns
map of LBM name -> timestamp

References from_string(), idx, and str_split().

Referenced by loadIntroductionTimes().

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

Member Data Documentation

◆ m_lbm_defs

std::unordered_map<std::string, LoadingBlockModifierDef *> LBMManager::m_lbm_defs
private

◆ m_lbm_lookup

◆ m_query_mode

bool LBMManager::m_query_mode = false
private

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