Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
CItemDefManager Class Reference
+ Inheritance diagram for CItemDefManager:
+ Collaboration diagram for CItemDefManager:

Public Member Functions

 CItemDefManager ()
 
virtual ~CItemDefManager ()
 
virtual const ItemDefinitionget (const std::string &name_) const
 
virtual const std::string & getAlias (const std::string &name) const
 
virtual void getAll (std::set< std::string > &result) const
 
virtual bool isKnown (const std::string &name_) const
 
void applyTextureOverrides (const std::vector< TextureOverride > &overrides)
 
void clear ()
 
virtual void registerItem (const ItemDefinition &def)
 
virtual void unregisterItem (const std::string &name)
 
virtual void registerAlias (const std::string &name, const std::string &convert_to)
 
void serialize (std::ostream &os, u16 protocol_version)
 
void deSerialize (std::istream &is, u16 protocol_version)
 
- Public Member Functions inherited from IWritableItemDefManager
 IWritableItemDefManager ()=default
 
virtual ~IWritableItemDefManager ()=default
 
- Public Member Functions inherited from IItemDefManager
 IItemDefManager ()=default
 
virtual ~IItemDefManager ()=default
 
virtual video::ITexture * getInventoryTexture (const ItemStack &item, Client *client) const
 
virtual ItemMeshgetWieldMesh (const ItemStack &item, Client *client) const
 Get wield mesh.
 
virtual PalettegetPalette (const ItemStack &item, Client *client) const
 
virtual video::SColor getItemstackColor (const ItemStack &stack, Client *client) const
 

Private Attributes

std::map< std::string, ItemDefinition * > m_item_definitions
 
StringMap m_aliases
 

Constructor & Destructor Documentation

◆ CItemDefManager()

CItemDefManager::CItemDefManager ( )
inline

References clear().

+ Here is the call graph for this function:

◆ ~CItemDefManager()

virtual CItemDefManager::~CItemDefManager ( )
inlinevirtual

References m_item_definitions.

Member Function Documentation

◆ applyTextureOverrides()

void CItemDefManager::applyTextureOverrides ( const std::vector< TextureOverride > & overrides)
inlinevirtual

◆ clear()

void CItemDefManager::clear ( )
inlinevirtual

Implements IWritableItemDefManager.

References ITEM_NODE, m_aliases, m_item_definitions, ItemDefinition::name, ItemDefinition::tool_capabilities, ItemDefinition::type, and ItemDefinition::wield_image.

Referenced by CItemDefManager(), and deSerialize().

+ Here is the caller graph for this function:

◆ deSerialize()

void CItemDefManager::deSerialize ( std::istream & is,
u16 protocol_version )
inlinevirtual

Implements IWritableItemDefManager.

References clear(), ItemDefinition::deSerialize(), deSerializeString16(), readU16(), readU8(), registerAlias(), and registerItem().

+ Here is the call graph for this function:

◆ get()

virtual const ItemDefinition & CItemDefManager::get ( const std::string & name_) const
inlinevirtual

Implements IItemDefManager.

References getAlias(), and m_item_definitions.

+ Here is the call graph for this function:

◆ getAlias()

virtual const std::string & CItemDefManager::getAlias ( const std::string & name) const
inlinevirtual

Implements IItemDefManager.

References m_aliases.

Referenced by get(), and isKnown().

+ Here is the caller graph for this function:

◆ getAll()

virtual void CItemDefManager::getAll ( std::set< std::string > & result) const
inlinevirtual

Implements IItemDefManager.

References m_aliases, and m_item_definitions.

◆ isKnown()

virtual bool CItemDefManager::isKnown ( const std::string & name_) const
inlinevirtual

Implements IItemDefManager.

References getAlias(), and m_item_definitions.

+ Here is the call graph for this function:

◆ registerAlias()

virtual void CItemDefManager::registerAlias ( const std::string & name,
const std::string & convert_to )
inlinevirtual

Implements IWritableItemDefManager.

References m_aliases, m_item_definitions, and TRACESTREAM.

Referenced by deSerialize().

+ Here is the caller graph for this function:

◆ registerItem()

virtual void CItemDefManager::registerItem ( const ItemDefinition & def)
inlinevirtual

Implements IWritableItemDefManager.

References FATAL_ERROR_IF, infostream, m_aliases, m_item_definitions, ItemDefinition::name, ItemDefinition::tool_capabilities, and TRACESTREAM.

Referenced by deSerialize().

+ Here is the caller graph for this function:

◆ serialize()

void CItemDefManager::serialize ( std::ostream & os,
u16 protocol_version )
inlinevirtual

Implements IItemDefManager.

References m_aliases, m_item_definitions, ItemDefinition::serialize(), serializeString16(), writeU16(), and writeU8().

+ Here is the call graph for this function:

◆ unregisterItem()

virtual void CItemDefManager::unregisterItem ( const std::string & name)
inlinevirtual

Member Data Documentation

◆ m_aliases

StringMap CItemDefManager::m_aliases
private

◆ m_item_definitions

std::map<std::string, ItemDefinition*> CItemDefManager::m_item_definitions
private

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