|
Crossfire Server
1.75.0
|
#include <TreasureLoader.h>
Inheritance diagram for TreasureLoader:Public Member Functions | |
| virtual void | load (BufferReader *reader, const std::string &filename) override |
| Load all treasures from a buffer. More... | |
| TreasureLoader (Treasures *treasures, Archetypes *archetypes, AssetsTracker *tracker) | |
| virtual bool | willLoad (const std::string &filename) override |
| Whether this instance will process or not the specified file. More... | |
Public Member Functions inherited from AssetLoader | |
| virtual | ~AssetLoader () |
| Virtual destructor for inheritance. More... | |
Private Member Functions | |
| treasure * | loadTreasure (BufferReader *reader, const std::string &filename) |
| Reads one treasure, including the 'yes', 'no' and 'more' options. More... | |
Private Attributes | |
| Archetypes * | m_archetypes |
| AssetsTracker * | m_tracker |
| Treasures * | m_treasures |
Definition at line 25 of file TreasureLoader.h.
| TreasureLoader::TreasureLoader | ( | Treasures * | treasures, |
| Archetypes * | archetypes, | ||
| AssetsTracker * | tracker | ||
| ) |
Definition at line 23 of file TreasureLoader.cpp.
References nroftreasures.
|
overridevirtual |
Load all treasures from a buffer.
| reader | where to read from. |
| filename | full path of the file for logging purposes. |
Implements AssetLoader.
Definition at line 111 of file TreasureLoader.cpp.
References add_string(), AssetsTracker::assetDefined(), buf, bufferreader_current_line(), bufferreader_next_line(), treasure::chance, AssetsCollection< T, Key >::define(), treasure::item, treasurelist::items, llevError, loadTreasure(), LOG(), m_tracker, m_treasures, MAX_BUF, treasure::name, treasurelist::name, archetype::name, treasure::next, treasure::next_no, treasure::next_yes, and treasurelist::total_chance.
Referenced by willLoad().
|
private |
Reads one treasure, including the 'yes', 'no' and 'more' options.
| reader | where to read from. |
| filename | full path of the file for logging purposes. |
Definition at line 40 of file TreasureLoader.cpp.
References add_string(), treasure::artifact, buf, bufferreader_current_line(), bufferreader_next_line(), treasure::chance, treasure::change_arch, fatal(), free_string(), AssetsCollection< T, Key >::get(), get_empty_treasure(), treasure::item, treasure::list_magic_adjustment, treasure::list_magic_value, llevError, LOG(), m_archetypes, treasure::magic, MAX_BUF, _change_arch::name, treasure::name, treasure::next, treasure::next_no, treasure::next_yes, treasure::nrof, nroftreasures, SEE_LAST_ERROR, _change_arch::slaying, and _change_arch::title.
Referenced by load().
|
inlineoverridevirtual |
Whether this instance will process or not the specified file.
| filename | full file path. |
Implements AssetLoader.
Definition at line 29 of file TreasureLoader.h.
References Utils::endsWith(), and load().
|
private |
Definition at line 37 of file TreasureLoader.h.
Referenced by loadTreasure().
|
private |
Definition at line 38 of file TreasureLoader.h.
Referenced by load().
|
private |
Definition at line 36 of file TreasureLoader.h.
Referenced by load().