Crossfire Server, Trunk  1.75.0
Facesets Class Reference

Available facesets for clients. More...

#include <Facesets.h>

+ Inheritance diagram for Facesets:
+ Collaboration diagram for Facesets:

Public Member Functions

face_setsfindById (int id)
 Attempt to find a faceset from its identifier. More...
 
- Public Member Functions inherited from AssetsCollection< face_sets >
void clear ()
 Clear all assets. More...
 
size_t count () const
 Get the number of assets. More...
 
face_setsdefine (const std::string &name, face_sets *asset)
 Define an asset, erasing an existing one. More...
 
void each (std::function< void(face_sets *)> op)
 Apply a function to each asset. More...
 
face_setsfind (const std::string &name)
 Get a named asset if it exists. More...
 
face_setsfirst (std::function< bool(const face_sets *)> op)
 Find the first asset matching some condition. More...
 
face_setsget (const std::string &name)
 Get a named asset. More...
 
std::vector< std::string > keys () const
 Get the names of all defined assets. More...
 
face_setsnext (face_sets *current)
 Allow browsing assets in a list-like manner. More...
 
const std::set< std::string > & undefined () const
 Return the list of undefined assets, that is assets requested through get() but not defined through define(). More...
 
virtual ~AssetsCollection ()
 Destroy this instance and all assets it owns. More...
 

Protected Member Functions

virtual void added (face_sets *face) override
 An asset was either referenced (but undefined) or defined. More...
 
virtual void replace (face_sets *existing, face_sets *update) override
 Replace an asset by an updated version. More...
 

Additional Inherited Members

- Protected Attributes inherited from AssetsCollection< face_sets >
std::unordered_map< std::string, face_sets * > m_assets
 Known assets. More...
 
std::set< std::string > m_undefined
 List of undefined assets. More...
 

Detailed Description

Available facesets for clients.

Definition at line 23 of file Facesets.h.

Member Function Documentation

◆ added()

void Facesets::added ( face_sets )
overrideprotectedvirtual

An asset was either referenced (but undefined) or defined.

Reimplemented from AssetsCollection< face_sets >.

Definition at line 61 of file Facesets.cpp.

References face(), and AssetsCollection< face_sets >::m_assets.

+ Here is the call graph for this function:

◆ findById()

face_sets * Facesets::findById ( int  id)

Attempt to find a faceset from its identifier.

Parameters
idfaceset identifier.
Returns
matching faceset, nullptr if no such faceset exists.

Definition at line 35 of file Facesets.cpp.

References is_valid_types_gen::found, and AssetsCollection< face_sets >::m_assets.

Referenced by find_faceset().

+ Here is the caller graph for this function:

◆ replace()

void Facesets::replace ( face_sets existing,
face_sets update 
)
overrideprotectedvirtual

Replace an asset by an updated version.

Parameters
existingasset to be updated.
updatenew version of the asset, which must be destroyed.

Implements AssetsCollection< face_sets >.

Definition at line 42 of file Facesets.cpp.

References face_sets::allocated, face_sets::comment, face_sets::extension, face_sets::faces, face_sets::fullname, face_sets::id, face_sets::prefix, and face_sets::size.


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