Crossfire Server, Trunk
|
#include <Messages.h>
Public Member Functions | |
Messages () | |
GeneralMessage * | random () |
Public Member Functions inherited from AssetsCollection< GeneralMessage > | |
void | clear () |
size_t | count () const |
GeneralMessage * | define (const std::string &name, GeneralMessage *asset) |
void | each (std::function< void(GeneralMessage *)> op) |
GeneralMessage * | find (const std::string &name) |
GeneralMessage * | first (std::function< bool(const GeneralMessage *)> op) |
GeneralMessage * | get (const std::string &name) |
std::vector< std::string > | keys () const |
GeneralMessage * | next (GeneralMessage *current) |
const std::set< std::string > & | undefined () const |
virtual | ~AssetsCollection () |
Protected Member Functions | |
virtual void | added (GeneralMessage *asset) override |
virtual void | replace (GeneralMessage *existing, GeneralMessage *update) override |
Protected Attributes | |
int | m_totalChance |
Protected Attributes inherited from AssetsCollection< GeneralMessage > | |
std::unordered_map< std::string, GeneralMessage * > | m_assets |
std::set< std::string > | m_undefined |
Definition at line 22 of file Messages.h.
Messages::Messages | ( | ) |
Definition at line 32 of file Messages.cpp.
|
overrideprotectedvirtual |
An asset was either referenced (but undefined) or defined.
Reimplemented from AssetsCollection< GeneralMessage >.
Definition at line 46 of file Messages.cpp.
References GeneralMessage::chance, and m_totalChance.
GeneralMessage * Messages::random | ( | ) |
Definition at line 50 of file Messages.cpp.
References AssetsCollection< GeneralMessage >::m_assets, m_totalChance, navar-midane_pickup::msg, and RANDOM.
Referenced by msgfile_msg().
|
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< GeneralMessage >.
Definition at line 35 of file Messages.cpp.
References asset_destroy(), GeneralMessage::chance, FREE_AND_COPY_IF, GeneralMessage::identifier, m_totalChance, GeneralMessage::message, GeneralMessage::quest_code, and GeneralMessage::title.
|
protected |
Definition at line 30 of file Messages.h.