Crossfire Server, Trunk
Faces Class Reference

#include <Faces.h>

+ Inheritance diagram for Faces:
+ Collaboration diagram for Faces:

Public Member Functions

int checksum () const
 
 Faces ()
 
const FacefindById (uint16_t id)
 
- Public Member Functions inherited from AssetsCollection< Face >
void clear ()
 
size_t count () const
 
Facedefine (const std::string &name, Face *asset)
 
void each (std::function< void(Face *)> op)
 
Facefind (const std::string &name)
 
Facefirst (std::function< bool(const Face *)> op)
 
Faceget (const std::string &name)
 
Facenext (Face *current)
 
const std::set< std::string > & undefined () const
 

Protected Member Functions

virtual void added (Face *face)
 
virtual Facecreate (const std::string &name)
 
virtual void destroy (Face *item)
 
virtual void replace (Face *existing, Face *update)
 

Protected Attributes

int m_checksum
 
- Protected Attributes inherited from AssetsCollection< Face >
std::map< std::string, Face * > m_assets
 
std::set< std::string > m_undefined
 

Detailed Description

Definition at line 21 of file Faces.h.

Constructor & Destructor Documentation

◆ Faces()

Faces::Faces ( )

Definition at line 16 of file Faces.cpp.

References blank_face, BLANK_FACE_NAME, empty_face, EMPTY_FACE_NAME, AssetsCollection< Face >::get(), smooth_face, and SMOOTH_FACE_NAME.

+ Here is the call graph for this function:

Member Function Documentation

◆ added()

void Faces::added ( Face )
protectedvirtual

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

Reimplemented from AssetsCollection< Face >.

Definition at line 50 of file Faces.cpp.

References banquet::l, AssetsCollection< Face >::m_assets, m_checksum, Face::name, Face::number, and ROTATE_RIGHT.

◆ checksum()

int Faces::checksum ( ) const
inline

Definition at line 27 of file Faces.h.

References m_checksum.

Referenced by get_bitmap_checksum().

+ Here is the caller graph for this function:

◆ create()

Face * Faces::create ( const std::string &  name)
protectedvirtual

Create a new asset.

Parameters
nameasset unique name.
Returns
asset.

Implements AssetsCollection< Face >.

Definition at line 22 of file Faces.cpp.

References add_string(), AssetsCollection< Face >::m_assets, Face::name, give::name, and Face::number.

+ Here is the call graph for this function:

◆ destroy()

void Faces::destroy ( Face item)
protectedvirtual

Destroy an asset.

Parameters
itemasset to destroy.

Implements AssetsCollection< Face >.

Definition at line 29 of file Faces.cpp.

References free_string().

Referenced by replace().

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

◆ findById()

const Face * Faces::findById ( uint16_t  id)

Definition at line 43 of file Faces.cpp.

References AssetsCollection< Face >::m_assets.

Referenced by get_face_by_id().

+ Here is the caller graph for this function:

◆ replace()

void Faces::replace ( Face existing,
Face update 
)
protectedvirtual

Replace an asset by an updated version.

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

Implements AssetsCollection< Face >.

Definition at line 34 of file Faces.cpp.

References destroy(), Face::magicmap, Face::smoothface, and Face::visibility.

+ Here is the call graph for this function:

Field Documentation

◆ m_checksum

int Faces::m_checksum
protected

Definition at line 30 of file Faces.h.

Referenced by added(), and checksum().


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