#include <TreasureLoader.h>
Public Member Functions | |
TreasureLoader () | |
~TreasureLoader () | |
void | loadDefaults () |
bool | parse (std::string, std::vector< TreasureInfo > &treasure) |
Private Member Functions | |
bool | internalParse (std::string desc, TreasureInfo &ti, bool loadingDefault) |
bool | parseUInt32Vector (std::string val, std::vector< uint32 > &vec) |
bool | parseUIntRange (std::string val, unsigned int &min, unsigned int &max) |
bool | parseDouble (std::string val, double &d) |
bool | parseInt (std::string val, int &i) |
Private Attributes | |
std::map< Pentagram::istring, TreasureInfo > | defaultTreasure |
Definition at line 26 of file TreasureLoader.h.
TreasureLoader::TreasureLoader | ( | ) |
Definition at line 25 of file TreasureLoader.cpp.
TreasureLoader::~TreasureLoader | ( | ) |
Definition at line 30 of file TreasureLoader.cpp.
bool TreasureLoader::internalParse | ( | std::string | desc, | |
TreasureInfo & | ti, | |||
bool | loadingDefault | |||
) | [private] |
Definition at line 79 of file TreasureLoader.cpp.
References TreasureInfo::chance, defaultTreasure, TreasureInfo::frames, TreasureInfo::map, TreasureInfo::maxcount, TreasureInfo::mincount, parseDouble(), parseInt(), parseUInt32Vector(), parseUIntRange(), TreasureInfo::shapes, TreasureInfo::special, Pentagram::SplitStringKV(), and x.
Referenced by loadDefaults(), and parse().
void TreasureLoader::loadDefaults | ( | ) |
load defaults from 'game' ini section
Definition at line 35 of file TreasureLoader.cpp.
References defaultTreasure, ConfigFileManager::get_instance(), internalParse(), ConfigFileManager::listKeyValues(), and perr.
Referenced by TypeFlags::loadMonsterInfo().
bool TreasureLoader::parse | ( | std::string | , | |
std::vector< TreasureInfo > & | treasure | |||
) |
parse treasure string into vector of TreasureInfo objects
Definition at line 58 of file TreasureLoader.cpp.
References internalParse(), and Pentagram::SplitString().
Referenced by TypeFlags::loadMonsterInfo().
bool TreasureLoader::parseDouble | ( | std::string | val, | |
double & | d | |||
) | [private] |
bool TreasureLoader::parseInt | ( | std::string | val, | |
int & | i | |||
) | [private] |
Definition at line 206 of file TreasureLoader.cpp.
Referenced by internalParse(), parseUInt32Vector(), and parseUIntRange().
bool TreasureLoader::parseUInt32Vector | ( | std::string | val, | |
std::vector< uint32 > & | vec | |||
) | [private] |
Definition at line 151 of file TreasureLoader.cpp.
References max(), min(), parseInt(), parseUIntRange(), and x.
Referenced by internalParse().
bool TreasureLoader::parseUIntRange | ( | std::string | val, | |
unsigned int & | min, | |||
unsigned int & | max | |||
) | [private] |
Definition at line 182 of file TreasureLoader.cpp.
References parseInt().
Referenced by internalParse(), and parseUInt32Vector().
std::map<Pentagram::istring, TreasureInfo> TreasureLoader::defaultTreasure [private] |