Crossfire Server, Trunk  1.75.0
AllAnimations Class Reference

#include <Animations.h>

+ Inheritance diagram for AllAnimations:
+ Collaboration diagram for AllAnimations:

Public Member Functions

 AllAnimations ()
 
- Public Member Functions inherited from AssetsCollection< Animations >
void clear ()
 Clear all assets. More...
 
size_t count () const
 Get the number of assets. More...
 
Animationsdefine (const std::string &name, Animations *asset)
 Define an asset, erasing an existing one. More...
 
void each (std::function< void(Animations *)> op)
 Apply a function to each asset. More...
 
Animationsfind (const std::string &name)
 Get a named asset if it exists. More...
 
Animationsfirst (std::function< bool(const Animations *)> op)
 Find the first asset matching some condition. More...
 
Animationsget (const std::string &name)
 Get a named asset. More...
 
std::vector< std::string > keys () const
 Get the names of all defined assets. More...
 
Animationsnext (Animations *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 (Animations *anim) override
 An asset was either referenced (but undefined) or defined. More...
 
virtual void replace (Animations *existing, Animations *update) override
 Replace an asset by an updated version. More...
 

Additional Inherited Members

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

Detailed Description

Definition at line 19 of file Animations.h.

Constructor & Destructor Documentation

◆ AllAnimations()

AllAnimations::AllAnimations ( )

Definition at line 32 of file Animations.cpp.

References AssetsCollection< Animations >::get(), and AssetsCollection< Animations >::m_undefined.

+ Here is the call graph for this function:

Member Function Documentation

◆ added()

void AllAnimations::added ( Animations )
overrideprotectedvirtual

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

Reimplemented from AssetsCollection< Animations >.

Definition at line 53 of file Animations.cpp.

References blank_face, face(), Animations::faces, Animations::has_blank, AssetsCollection< Animations >::m_assets, Animations::num, and Animations::num_animations.

+ Here is the call graph for this function:

◆ replace()

void AllAnimations::replace ( Animations existing,
Animations 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< Animations >.

Definition at line 37 of file Animations.cpp.

References blank_face, face(), Animations::faces, Animations::facings, free_string(), Animations::has_blank, Animations::name, and Animations::num_animations.

+ Here is the call graph for this function:

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