Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 29, 2005, 11:58:22 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: loading clean now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/physics/physics_engine.cc

    r4731 r4733  
    2323#include "tinyxml.h"
    2424#include "factory.h"
     25#include "load_param.h"
    2526
    2627using namespace std;
     
    5859void PhysicsEngine::loadParams(const TiXmlElement* root)
    5960{
    60   const TiXmlElement* element = NULL;
    61 
     61  LoadParam<PhysicsEngine>(root, "Fields", this, &PhysicsEngine::loadFields)
     62      .describe("loads a list of fields");
     63
     64  LoadParam<PhysicsEngine>(root, "Connections", this, &PhysicsEngine::loadConnections)
     65      .describe("loads a list of fields");
     66}
     67
     68/**
     69 * \param root the XML-element to Load the PhysicsField from
     70 */
     71void PhysicsEngine::loadFields(const TiXmlElement* root)
     72{
    6273  PRINTF(4)("Loading Physical Fields\n");
    63   element = root->FirstChildElement("Fields");
    64   element = element->FirstChildElement();
     74
     75  const TiXmlElement* element = root->FirstChildElement();
    6576  while (element != NULL)
    6677  {
     
    6980    element = element->NextSiblingElement();
    7081  }
    71   element = NULL;
    72 
     82}
     83
     84/**
     85 * \param root the XML-element to load the PhysicsConnection from
     86 */
     87void PhysicsEngine::loadConnections(const TiXmlElement* root)
     88{
    7389  PRINTF(4)("Loading Physical Connections\n");
    74   element = root->FirstChildElement("Connections");
    75   element = element->FirstChildElement();
     90
     91  const TiXmlElement* element = root->FirstChildElement();
    7692  while (element != NULL)
    7793  {
Note: See TracChangeset for help on using the changeset viewer.