![]() |
Crossfire Server, Trunk
1.75.0
|
Available facesets for clients. More...
#include <Facesets.h>
Public Member Functions | |
face_sets * | findById (int id) |
Attempt to find a faceset from its identifier. More... | |
![]() | |
void | clear () |
Clear all assets. More... | |
size_t | count () const |
Get the number of assets. More... | |
face_sets * | define (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_sets * | find (const std::string &name) |
Get a named asset if it exists. More... | |
face_sets * | first (std::function< bool(const face_sets *)> op) |
Find the first asset matching some condition. More... | |
face_sets * | get (const std::string &name) |
Get a named asset. More... | |
std::vector< std::string > | keys () const |
Get the names of all defined assets. More... | |
face_sets * | next (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 | |
![]() | |
std::unordered_map< std::string, face_sets * > | m_assets |
Known assets. More... | |
std::set< std::string > | m_undefined |
List of undefined assets. More... | |
Available facesets for clients.
Definition at line 23 of file Facesets.h.
|
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.
face_sets * Facesets::findById | ( | int | id | ) |
Attempt to find a faceset from its identifier.
id | faceset identifier. |
Definition at line 35 of file Facesets.cpp.
References is_valid_types_gen::found, and AssetsCollection< face_sets >::m_assets.
Referenced by find_faceset().
Replace an asset by an updated version.
existing | asset to be updated. |
update | new 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.