Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
NameIdMapping Class Reference

#include <nameidmapping.h>

+ Collaboration diagram for NameIdMapping:

Public Member Functions

void serialize (std::ostream &os) const
 
void deSerialize (std::istream &is)
 
void clear ()
 
void set (u16 id, const std::string &name)
 
void removeId (u16 id)
 
void eraseName (const std::string &name)
 
bool getName (u16 id, std::string &result) const
 
bool getId (const std::string &name, u16 &result) const
 
u16 size () const
 

Private Attributes

IdToNameMap m_id_to_name
 
NameToIdMap m_name_to_id
 

Member Function Documentation

◆ clear()

void NameIdMapping::clear ( )
inline

References m_id_to_name, and m_name_to_id.

Referenced by NodeDefManager::clear().

+ Here is the caller graph for this function:

◆ deSerialize()

void NameIdMapping::deSerialize ( std::istream & is)

References deSerializeString16(), m_id_to_name, m_name_to_id, readU16(), and readU8().

Referenced by MapBlock::deSerialize(), and MapBlock::deSerialize_pre22().

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

◆ eraseName()

void NameIdMapping::eraseName ( const std::string & name)
inline

References getId(), m_id_to_name, and m_name_to_id.

Referenced by NodeDefManager::removeNode().

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

◆ getId()

bool NameIdMapping::getId ( const std::string & name,
u16 & result ) const
inline

References m_name_to_id.

Referenced by MapBlock::deSerialize(), NodeDefManager::deSerialize(), MapBlock::deSerialize_pre22(), eraseName(), NodeDefManager::removeNode(), NodeDefManager::set(), and NodeDefManager::updateAliases().

+ Here is the caller graph for this function:

◆ getName()

bool NameIdMapping::getName ( u16 id,
std::string & result ) const
inline

References m_id_to_name.

Referenced by correctBlockNodeIds(), ItemStack::deSerialize(), and removeId().

+ Here is the caller graph for this function:

◆ removeId()

void NameIdMapping::removeId ( u16 id)
inline

References getName(), m_id_to_name, and m_name_to_id.

+ Here is the call graph for this function:

◆ serialize()

void NameIdMapping::serialize ( std::ostream & os) const

References m_id_to_name, serializeString16(), writeU16(), and writeU8().

Referenced by MapBlock::serialize().

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

◆ set()

void NameIdMapping::set ( u16 id,
const std::string & name )
inline

References m_id_to_name, and m_name_to_id.

Referenced by NodeDefManager::addNameIdMapping(), content_mapnode_get_name_id_mapping(), and getBlockNodeIdMapping().

+ Here is the caller graph for this function:

◆ size()

u16 NameIdMapping::size ( ) const
inline

References m_id_to_name.

Referenced by MapBlock::deSerialize(), and MapBlock::deSerialize_pre22().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_id_to_name

IdToNameMap NameIdMapping::m_id_to_name
private

◆ m_name_to_id

NameToIdMap NameIdMapping::m_name_to_id
private

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