Crossfire Server, Trunk
TreasureLoader Class Reference

#include <TreasureLoader.h>

+ Inheritance diagram for TreasureLoader:
+ Collaboration diagram for TreasureLoader:

Public Member Functions

virtual void load (BufferReader *reader, const std::string &filename) override
 TreasureLoader (Treasures *treasures, Archetypes *archetypes, AssetsTracker *tracker)
virtual bool willLoad (const std::string &filename) override
- Public Member Functions inherited from AssetLoader
virtual ~AssetLoader ()

Private Member Functions

treasureloadTreasure (BufferReader *reader, const std::string &filename)

Private Attributes


Detailed Description

Definition at line 25 of file TreasureLoader.h.

Constructor & Destructor Documentation

◆ TreasureLoader()

TreasureLoader::TreasureLoader ( Treasures treasures,
Archetypes archetypes,
AssetsTracker tracker 

Definition at line 23 of file TreasureLoader.cpp.

Member Function Documentation

◆ load()

void TreasureLoader::load ( BufferReader reader,
const std::string &  filename 

Load all treasures from a buffer.

readerwhere to read from.
filenamefull 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(), AssetsCollection< T, Key >::define(), npc_dialog::filename, treasurelist::items, llevError, loadTreasure(), LOG(), m_tracker, m_treasures, MAX_BUF, give::name, treasurelist::name, Floor::t, and treasurelist::total_chance.

+ Here is the call graph for this function:

◆ willLoad()

virtual bool TreasureLoader::willLoad ( const std::string &  filename)

Whether this instance will process or not the specified file.

filenamefull file path.
true if processFile() should be called, false else.

Implements AssetLoader.

Definition at line 29 of file TreasureLoader.h.

References Utils::endsWith(), and npc_dialog::filename.

+ Here is the call graph for this function:

Field Documentation

◆ m_archetypes

Archetypes* TreasureLoader::m_archetypes

Definition at line 37 of file TreasureLoader.h.

Referenced by loadTreasure().

◆ m_tracker

AssetsTracker* TreasureLoader::m_tracker

Definition at line 38 of file TreasureLoader.h.

Referenced by load().

◆ m_treasures

Treasures* TreasureLoader::m_treasures

Definition at line 36 of file TreasureLoader.h.

Referenced by load().

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