![]() |
Crossfire Server, Trunk
1.75.0
|
#include <Faces.h>
Public Member Functions | |
int | checksum () const |
Faces () | |
const Face * | findById (uint16_t id) |
![]() | |
void | clear () |
Clear all assets. More... | |
size_t | count () const |
Get the number of assets. More... | |
Face * | define (const std::string &name, Face *asset) |
Define an asset, erasing an existing one. More... | |
void | each (std::function< void(Face *)> op) |
Apply a function to each asset. More... | |
Face * | find (const std::string &name) |
Get a named asset if it exists. More... | |
Face * | first (std::function< bool(const Face *)> op) |
Find the first asset matching some condition. More... | |
Face * | 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 * | next (Face *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 *face) override |
An asset was either referenced (but undefined) or defined. More... | |
virtual void | replace (Face *existing, Face *update) override |
Replace an asset by an updated version. More... | |
Protected Attributes | |
int | m_checksum |
![]() | |
std::unordered_map< std::string, Face * > | m_assets |
Known assets. More... | |
std::set< std::string > | m_undefined |
List of undefined assets. More... | |
Faces::Faces | ( | ) |
Definition at line 29 of file Faces.cpp.
References blank_face, BLANK_FACE_NAME, empty_face, EMPTY_FACE_NAME, AssetsCollection< Face >::get(), smooth_face, and SMOOTH_FACE_NAME.
|
overrideprotectedvirtual |
An asset was either referenced (but undefined) or defined.
Reimplemented from AssetsCollection< Face >.
Definition at line 51 of file Faces.cpp.
References face(), AssetsCollection< Face >::m_assets, m_checksum, treasurelist::name, and ROTATE_RIGHT.
|
inline |
Definition at line 25 of file Faces.h.
References m_checksum.
const Face * Faces::findById | ( | uint16_t | id | ) |
Definition at line 44 of file Faces.cpp.
References face(), and AssetsCollection< Face >::m_assets.
Referenced by get_face_by_id().
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 >.
Definition at line 35 of file Faces.cpp.
References asset_destroy(), Face::magicmap, Face::smoothface, and Face::visibility.
|
protected |
Definition at line 28 of file Faces.h.
Referenced by added(), and checksum().