Minetest  0.4.16
CNodeDefManager Class Reference
+ Inheritance diagram for CNodeDefManager:
+ Collaboration diagram for CNodeDefManager:

Public Member Functions

 CNodeDefManager ()
 
virtual ~CNodeDefManager ()
 
void clear ()
 
virtual IWritableNodeDefManagerclone ()
 
virtual const ContentFeaturesget (content_t c) const
 
virtual const ContentFeaturesget (const MapNode &n) const
 
virtual bool getId (const std::string &name, content_t &result) const
 
virtual content_t getId (const std::string &name) const
 
virtual bool getIds (const std::string &name, std::set< content_t > &result) const
 
virtual const ContentFeaturesget (const std::string &name) const
 
content_t allocateId ()
 
virtual content_t set (const std::string &name, const ContentFeatures &def)
 
virtual content_t allocateDummy (const std::string &name)
 
virtual void removeNode (const std::string &name)
 
virtual void updateAliases (IItemDefManager *idef)
 
virtual void applyTextureOverrides (const std::string &override_filepath)
 
virtual void updateTextures (IGameDef *gamedef, void(*progress_cbk)(void *progress_args, u32 progress, u32 max_progress), void *progress_cbk_args)
 
void serialize (std::ostream &os, u16 protocol_version) const
 
void deSerialize (std::istream &is)
 
virtual void setNodeRegistrationStatus (bool completed)
 
virtual void pendNodeResolve (NodeResolver *nr)
 
virtual bool cancelNodeResolveCallback (NodeResolver *nr)
 
virtual void runNodeResolveCallbacks ()
 
virtual void resetNodeResolveState ()
 
virtual void mapNodeboxConnections ()
 
virtual bool nodeboxConnects (MapNode from, MapNode to, u8 connect_face)
 
virtual core::aabbox3d< s16 > getSelectionBoxIntUnion () const
 
- Public Member Functions inherited from IWritableNodeDefManager
 IWritableNodeDefManager ()
 
virtual ~IWritableNodeDefManager ()
 
- Public Member Functions inherited from INodeDefManager
 INodeDefManager ()
 
virtual ~INodeDefManager ()
 

Private Member Functions

void addNameIdMapping (content_t i, std::string name)
 
void fixSelectionBoxIntUnion ()
 

Private Attributes

std::vector< ContentFeaturesm_content_features
 
NameIdMapping m_name_id_mapping
 
UNORDERED_MAP< std::string, content_tm_name_id_mapping_with_aliases
 
UNORDERED_MAP< std::string, GroupItemsm_group_to_items
 
content_t m_next_id
 
std::vector< NodeResolver * > m_pending_resolve_callbacks
 
bool m_node_registration_complete
 
aabb3f m_selection_box_union
 The union of all nodes' selection boxes. More...
 
core::aabbox3d< s16 > m_selection_box_int_union
 

Constructor & Destructor Documentation

◆ CNodeDefManager()

CNodeDefManager::CNodeDefManager ( )

References clear().

Referenced by clone().

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

◆ ~CNodeDefManager()

CNodeDefManager::~CNodeDefManager ( )
virtual

Member Function Documentation

◆ addNameIdMapping()

void CNodeDefManager::addNameIdMapping ( content_t  i,
std::string  name 
)
private

References m_name_id_mapping, m_name_id_mapping_with_aliases, and NameIdMapping::set().

Referenced by clear(), deSerialize(), and set().

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

◆ allocateDummy()

content_t CNodeDefManager::allocateDummy ( const std::string &  name)
virtual

Implements IWritableNodeDefManager.

References ContentFeatures::name, and set().

+ Here is the call graph for this function:

◆ allocateId()

content_t CNodeDefManager::allocateId ( )

References CONTENT_IGNORE, m_content_features, m_next_id, and ContentFeatures::name.

Referenced by set().

+ Here is the caller graph for this function:

◆ applyTextureOverrides()

void CNodeDefManager::applyTextureOverrides ( const std::string &  override_filepath)
virtual

Implements IWritableNodeDefManager.

References errorstream, getId(), infostream, m_content_features, TileDef::name, str_split(), ContentFeatures::tiledef, and trim().

+ Here is the call graph for this function:

◆ cancelNodeResolveCallback()

bool CNodeDefManager::cancelNodeResolveCallback ( NodeResolver nr)
virtual

◆ clear()

void CNodeDefManager::clear ( )

◆ clone()

IWritableNodeDefManager * CNodeDefManager::clone ( )
virtual

Implements IWritableNodeDefManager.

References CNodeDefManager().

+ Here is the call graph for this function:

◆ deSerialize()

void CNodeDefManager::deSerialize ( std::istream &  is)
virtual

◆ fixSelectionBoxIntUnion()

void CNodeDefManager::fixSelectionBoxIntUnion ( )
inlineprivate

Recalculates m_selection_box_int_union based on m_selection_box_union.

References BS, m_selection_box_int_union, and m_selection_box_union.

Referenced by deSerialize(), and set().

+ Here is the caller graph for this function:

◆ get() [1/3]

const ContentFeatures & CNodeDefManager::get ( const MapNode n) const
inlinevirtual

Implements IWritableNodeDefManager.

References get(), and MapNode::getContent().

+ Here is the call graph for this function:

◆ get() [2/3]

const ContentFeatures & CNodeDefManager::get ( const std::string &  name) const
virtual

Implements IWritableNodeDefManager.

References CONTENT_UNKNOWN, get(), and getId().

+ Here is the call graph for this function:

◆ get() [3/3]

const ContentFeatures & CNodeDefManager::get ( content_t  c) const
inlinevirtual

Implements IWritableNodeDefManager.

References CONTENT_UNKNOWN, and m_content_features.

Referenced by get(), and nodeboxConnects().

+ Here is the caller graph for this function:

◆ getId() [1/2]

content_t CNodeDefManager::getId ( const std::string &  name) const
virtual

Implements IWritableNodeDefManager.

References CONTENT_IGNORE, and getId().

+ Here is the call graph for this function:

◆ getId() [2/2]

bool CNodeDefManager::getId ( const std::string &  name,
content_t result 
) const
virtual

Implements IWritableNodeDefManager.

References m_name_id_mapping_with_aliases.

Referenced by applyTextureOverrides(), get(), getId(), and getIds().

+ Here is the caller graph for this function:

◆ getIds()

bool CNodeDefManager::getIds ( const std::string &  name,
std::set< content_t > &  result 
) const
virtual

Implements IWritableNodeDefManager.

References CONTENT_IGNORE, getId(), and m_group_to_items.

Referenced by mapNodeboxConnections().

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

◆ getSelectionBoxIntUnion()

virtual core::aabbox3d<s16> CNodeDefManager::getSelectionBoxIntUnion ( ) const
inlinevirtual

Returns the smallest box in node coordinates that contains all nodes' selection boxes.

Implements IWritableNodeDefManager.

References m_selection_box_int_union.

◆ mapNodeboxConnections()

void CNodeDefManager::mapNodeboxConnections ( )
virtual

Implements IWritableNodeDefManager.

References ContentFeatures::connects_to, ContentFeatures::connects_to_ids, ContentFeatures::drawtype, getIds(), m_content_features, NDT_NODEBOX, ContentFeatures::node_box, NODEBOX_CONNECTED, and NodeBox::type.

+ Here is the call graph for this function:

◆ nodeboxConnects()

bool CNodeDefManager::nodeboxConnects ( MapNode  from,
MapNode  to,
u8  connect_face 
)
virtual

Implements INodeDefManager.

References ContentFeatures::connect_sides, ContentFeatures::connects_to_ids, CPT2_COLORED_FACEDIR, CPT2_FACEDIR, ContentFeatures::drawtype, get(), NDT_NODEBOX, ContentFeatures::node_box, NODEBOX_CONNECTED, MapNode::param0, MapNode::param2, ContentFeatures::param_type_2, and NodeBox::type.

+ Here is the call graph for this function:

◆ pendNodeResolve()

void CNodeDefManager::pendNodeResolve ( NodeResolver nr)
virtual

Implements IWritableNodeDefManager.

References NodeResolver::m_ndef, m_node_registration_complete, m_pending_resolve_callbacks, and NodeResolver::nodeResolveInternal().

+ Here is the call graph for this function:

◆ removeNode()

void CNodeDefManager::removeNode ( const std::string &  name)
virtual

Implements IWritableNodeDefManager.

References CONTENT_IGNORE, NameIdMapping::eraseName(), NameIdMapping::getId(), m_group_to_items, m_name_id_mapping, and m_name_id_mapping_with_aliases.

+ Here is the call graph for this function:

◆ resetNodeResolveState()

void CNodeDefManager::resetNodeResolveState ( )
virtual

Implements IWritableNodeDefManager.

References m_node_registration_complete, and m_pending_resolve_callbacks.

Referenced by clear().

+ Here is the caller graph for this function:

◆ runNodeResolveCallbacks()

void CNodeDefManager::runNodeResolveCallbacks ( )
virtual

Implements IWritableNodeDefManager.

References m_pending_resolve_callbacks, and NodeResolver::nodeResolveInternal().

+ Here is the call graph for this function:

◆ serialize()

void CNodeDefManager::serialize ( std::ostream &  os,
u16  protocol_version 
) const
virtual

Implements IWritableNodeDefManager.

References CONTENT_AIR, CONTENT_IGNORE, CONTENT_UNKNOWN, FATAL_ERROR_IF, m_content_features, ContentFeatures::name, ContentFeatures::serialize(), serializeLongString(), serializeString(), writeU16(), and writeU8().

+ Here is the call graph for this function:

◆ set()

content_t CNodeDefManager::set ( const std::string &  name,
const ContentFeatures def 
)
virtual

Implements IWritableNodeDefManager.

References addNameIdMapping(), allocateId(), CONTENT_IGNORE, fixSelectionBoxIntUnion(), NameIdMapping::getId(), getNodeBoxUnion(), ContentFeatures::groups, m_content_features, m_group_to_items, m_name_id_mapping, m_selection_box_union, ContentFeatures::name, ContentFeatures::selection_box, verbosestream, and warningstream.

Referenced by allocateDummy().

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

◆ setNodeRegistrationStatus()

void CNodeDefManager::setNodeRegistrationStatus ( bool  completed)
inlinevirtual

◆ updateAliases()

void CNodeDefManager::updateAliases ( IItemDefManager idef)
virtual

Implements IWritableNodeDefManager.

References IItemDefManager::getAlias(), IItemDefManager::getAll(), NameIdMapping::getId(), m_name_id_mapping, and m_name_id_mapping_with_aliases.

+ Here is the call graph for this function:

◆ updateTextures()

void CNodeDefManager::updateTextures ( IGameDef gamedef,
void(*)(void *progress_args, u32 progress, u32 max_progress)  progress_cbk,
void *  progress_cbk_args 
)
virtual

Implements IWritableNodeDefManager.

References Client::getSceneManager(), Client::getShaderSource(), infostream, m_content_features, TextureSettings::readSettings(), Client::tsrc(), and ContentFeatures::updateTextures().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_content_features

◆ m_group_to_items

UNORDERED_MAP<std::string, GroupItems> CNodeDefManager::m_group_to_items
private

Referenced by clear(), getIds(), removeNode(), and set().

◆ m_name_id_mapping

NameIdMapping CNodeDefManager::m_name_id_mapping
private

◆ m_name_id_mapping_with_aliases

UNORDERED_MAP<std::string, content_t> CNodeDefManager::m_name_id_mapping_with_aliases
private

◆ m_next_id

content_t CNodeDefManager::m_next_id
private

Referenced by allocateId(), and clear().

◆ m_node_registration_complete

bool CNodeDefManager::m_node_registration_complete
private

◆ m_pending_resolve_callbacks

std::vector<NodeResolver *> CNodeDefManager::m_pending_resolve_callbacks
private

◆ m_selection_box_int_union

core::aabbox3d<s16> CNodeDefManager::m_selection_box_int_union
private

The smallest box in node coordinates that contains all nodes' selection boxes.

Referenced by clear(), fixSelectionBoxIntUnion(), and getSelectionBoxIntUnion().

◆ m_selection_box_union

aabb3f CNodeDefManager::m_selection_box_union
private

The union of all nodes' selection boxes.

Referenced by clear(), deSerialize(), fixSelectionBoxIntUnion(), and set().


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