![]() |
Crossfire Server, Trunk
1.75.0
|
#include <Quests.h>
Public Member Functions | |
Quests () | |
size_t | visibleCount () const |
virtual | ~Quests () |
![]() | |
void | clear () |
Clear all assets. More... | |
size_t | count () const |
Get the number of assets. More... | |
quest_definition * | define (const std::string &name, quest_definition *asset) |
Define an asset, erasing an existing one. More... | |
void | each (std::function< void(quest_definition *)> op) |
Apply a function to each asset. More... | |
quest_definition * | find (const std::string &name) |
Get a named asset if it exists. More... | |
quest_definition * | first (std::function< bool(const quest_definition *)> op) |
Find the first asset matching some condition. More... | |
quest_definition * | get (const std::string &name) |
Get a named asset. More... | |
std::vector< std::string > | keys () const |
Get the names of all defined assets. More... | |
quest_definition * | next (quest_definition *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 (quest_definition *quest) override |
An asset was either referenced (but undefined) or defined. More... | |
virtual void | replace (quest_definition *existing, quest_definition *update) override |
Replace an asset by an updated version. More... | |
Private Attributes | |
size_t | visibleQuests |
Additional Inherited Members | |
![]() | |
std::unordered_map< std::string, quest_definition * > | m_assets |
Known assets. More... | |
std::set< std::string > | m_undefined |
List of undefined assets. More... | |
Quests::Quests | ( | ) |
Definition at line 25 of file Quests.cpp.
|
virtual |
Definition at line 28 of file Quests.cpp.
|
overrideprotectedvirtual |
An asset was either referenced (but undefined) or defined.
Reimplemented from AssetsCollection< quest_definition >.
Definition at line 43 of file Quests.cpp.
References quest_definition::client_code, AssetsCollection< quest_definition >::m_assets, quest_definition::quest_is_system, and visibleQuests.
|
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< quest_definition >.
Definition at line 31 of file Quests.cpp.
References quest_clear(), quest_definition::quest_is_system, and visibleQuests.
|
inline |
Definition at line 24 of file Quests.h.
References visibleQuests.
Referenced by quests_count().
|
private |
Definition at line 31 of file Quests.h.
Referenced by added(), replace(), and visibleCount().