ObjectConfig Class Reference

#include <object_cfg.h>

Inheritance diagram for ObjectConfig:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 ObjectConfig ()
 ~ObjectConfig ()
void LoadXml (const std::string &obj_name, const std::string &config_file)

Public Attributes

double m_mass
double m_wind_factor
double m_air_resist_factor
double m_gravity_factor
bool m_rebounding
double m_rebound_factor

Detailed Description

Definition at line 29 of file object_cfg.h.


Constructor & Destructor Documentation

ObjectConfig::ObjectConfig (  ) 

Definition at line 31 of file object_cfg.cpp.

00032 {
00033   m_rebounding = false;
00034   m_rebound_factor = 0.01;
00035   m_air_resist_factor = 1.0;
00036   m_wind_factor = 1.0;
00037   m_gravity_factor = 1.0;
00038   m_mass = 1.0;
00039 }

ObjectConfig::~ObjectConfig (  ) 

Definition at line 41 of file object_cfg.cpp.

00042 {
00043 }


Member Function Documentation

void ObjectConfig::LoadXml ( const std::string &  obj_name,
const std::string &  config_file 
)

Definition at line 45 of file object_cfg.cpp.

00046 {
00047   std::string file;
00048   if(config_file=="")
00049     file = Config::GetInstance()->GetDataDir() + PATH_SEPARATOR + "game_mode" + PATH_SEPARATOR + "objects.xml";
00050   else
00051     file = config_file;
00052 
00053   // Load Xml configuration
00054   XmlReader doc;
00055   assert(doc.Load(file));
00056   xmlpp::Element* elem = XmlReader::GetMarker(doc.GetRoot(), obj_name);
00057 
00058   assert(elem != NULL);
00059   XmlReader::ReadDouble(elem, "mass", m_mass);
00060   XmlReader::ReadDouble(elem, "wind_factor", m_wind_factor);
00061   XmlReader::ReadDouble(elem, "air_resist_factor", m_air_resist_factor);
00062   XmlReader::ReadDouble(elem, "gravity_factor", m_gravity_factor);
00063   XmlReader::ReadDouble(elem, "rebound_factor", m_rebound_factor);
00064   XmlReader::ReadBool(elem, "rebounding", m_rebounding);
00065 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

double ObjectConfig::m_air_resist_factor

Definition at line 39 of file object_cfg.h.

double ObjectConfig::m_gravity_factor

Definition at line 42 of file object_cfg.h.

double ObjectConfig::m_mass

Definition at line 33 of file object_cfg.h.

double ObjectConfig::m_rebound_factor

Definition at line 48 of file object_cfg.h.

bool ObjectConfig::m_rebounding

Definition at line 45 of file object_cfg.h.

double ObjectConfig::m_wind_factor

Definition at line 36 of file object_cfg.h.


The documentation for this class was generated from the following files:
Generated on Mon Jan 1 14:04:10 2007 for Wormux by  doxygen 1.4.7