TreasureLoader Class Reference

#include <TreasureLoader.h>

List of all members.

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


Detailed Description

Definition at line 26 of file TreasureLoader.h.


Constructor & Destructor Documentation

TreasureLoader::TreasureLoader (  ) 

Definition at line 25 of file TreasureLoader.cpp.

TreasureLoader::~TreasureLoader (  ) 

Definition at line 30 of file TreasureLoader.cpp.


Member Function Documentation

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]

Definition at line 199 of file TreasureLoader.cpp.

Referenced by internalParse().

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().


Member Data Documentation

std::map<Pentagram::istring, TreasureInfo> TreasureLoader::defaultTreasure [private]

Definition at line 39 of file TreasureLoader.h.

Referenced by internalParse(), and loadDefaults().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 22:30:04 2007 for pentagram by  doxygen 1.4.7