Crossfire Server, Trunk
Treasures Class Reference

#include <Treasures.h>

+ Inheritance diagram for Treasures:
+ Collaboration diagram for Treasures:

Protected Member Functions

virtual treasurelistcreate (const std::string &name)
 
virtual void destroy (treasurelist *item)
 
virtual void replace (treasurelist *existing, treasurelist *update)
 
- Protected Member Functions inherited from AssetsCollection< treasurelist >
virtual void added (treasurelist *)
 

Additional Inherited Members

- Public Member Functions inherited from AssetsCollection< treasurelist >
void clear ()
 
size_t count () const
 
treasurelistdefine (const std::string &name, treasurelist *asset)
 
void each (std::function< void(treasurelist *)> op)
 
treasurelistfind (const std::string &name)
 
treasurelistfirst (std::function< bool(const treasurelist *)> op)
 
treasurelistget (const std::string &name)
 
treasurelistnext (treasurelist *current)
 
const std::set< std::string > & undefined () const
 
- Protected Attributes inherited from AssetsCollection< treasurelist >
std::map< std::string, treasurelist * > m_assets
 
std::set< std::string > m_undefined
 

Detailed Description

Definition at line 23 of file Treasures.h.

Member Function Documentation

◆ create()

treasurelist * Treasures::create ( const std::string &  name)
protectedvirtual

Create a new asset.

Parameters
nameasset unique name.
Returns
asset.

Implements AssetsCollection< treasurelist >.

Definition at line 15 of file Treasures.cpp.

References add_string(), give::name, and treasureliststruct::name.

+ Here is the call graph for this function:

◆ destroy()

void Treasures::destroy ( treasurelist item)
protectedvirtual

Destroy an asset.

Parameters
itemasset to destroy.

Implements AssetsCollection< treasurelist >.

Definition at line 21 of file Treasures.cpp.

References free_string(), and treasure_free().

Referenced by replace().

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

◆ replace()

void Treasures::replace ( treasurelist existing,
treasurelist 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< treasurelist >.

Definition at line 29 of file Treasures.cpp.

References destroy(), treasureliststruct::items, treasureliststruct::total_chance, and treasure_free().

+ Here is the call graph for this function:

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