![]() |
Crossfire Server, Trunk
1.75.0
|
#include <Treasures.h>
Protected Member Functions | |
virtual void | replace (treasurelist *existing, treasurelist *update) override |
Replace an asset by an updated version. More... | |
![]() | |
virtual void | added (treasurelist *) |
An asset was either referenced (but undefined) or defined. More... | |
Additional Inherited Members | |
![]() | |
void | clear () |
Clear all assets. More... | |
size_t | count () const |
Get the number of assets. More... | |
treasurelist * | define (const std::string &name, treasurelist *asset) |
Define an asset, erasing an existing one. More... | |
void | each (std::function< void(treasurelist *)> op) |
Apply a function to each asset. More... | |
treasurelist * | find (const std::string &name) |
Get a named asset if it exists. More... | |
treasurelist * | first (std::function< bool(const treasurelist *)> op) |
Find the first asset matching some condition. More... | |
treasurelist * | get (const std::string &name) |
Get a named asset. More... | |
std::vector< std::string > | keys () const |
Get the names of all defined assets. More... | |
treasurelist * | next (treasurelist *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... | |
![]() | |
std::unordered_map< std::string, treasurelist * > | m_assets |
Known assets. More... | |
std::set< std::string > | m_undefined |
List of undefined assets. More... | |
Definition at line 21 of file Treasures.h.
|
overrideprotectedvirtual |
Replace an asset by an updated version.
existing | asset to be updated. |
update | new version of the asset, which must be destroyed. |
Implements AssetsCollection< treasurelist >.
Definition at line 31 of file Treasures.cpp.
References asset_destroy(), treasurelist::items, treasurelist::total_chance, and treasure_free().