Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4834 in orxonox.OLD for orxonox/trunk/src/util


Ignore:
Timestamp:
Jul 11, 2005, 5:47:23 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: crosshair in WeaponManager (instead of World) and implemented easy Cyling for LoadParam

Location:
orxonox/trunk/src/util
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/util/loading/load_param.h

    r4746 r4834  
    3434//! macro that makes it even more easy to load a Parameter
    3535/**
    36    \param className the name of the class to load
    37    \param parameterName the name of the parameter to load as written in the XML-file
    38    \param function the function to call
    39 */
     36 * @param className the name of the class to load
     37 * @param parameterName the name of the parameter to load as written in the XML-file
     38 * @param function the function to call
     39 */
    4040#define LOAD_PARAM(className, parameterName, paramFunction) \
    4141        LoadParam<className>(root, #parameterName, this, &className::paramFunction)
     42
     43/**
     44 * this Starts a Cycle in the Loading Process
     45 * be aware, that in the cycle the first parameter of load_param should because
     46 * called element, and that you must say true at the Fith parameter, or it will fail
     47 * also you will have to close the Cycle again with LOAD_PARAM_END_CYCLE
     48 */
     49#define LOAD_PARAM_START_CYCLE   const TiXmlElement* element; \
     50                                 element = root->FirstChildElement(); \
     51                                 while( element != NULL) \
     52                                  {
     53/**
     54 * closes a LoadParam Loop
     55 * @see LOAD_PARAM_START_CYCLE
     56 */
     57#define LOAD_PARAM_END_CYCLE        element = element->NextSiblingElement(); \
     58                                  }
     59
     60
    4261
    4362/**
  • orxonox/trunk/src/util/track/track_manager.cc

    r4832 r4834  
    394394   \param root the TiXmlElement to load the Data from
    395395*/
    396 bool TrackManager::loadParams( TiXmlElement* root)
    397 {
    398   TiXmlElement* element;
    399   TiXmlNode* container;
     396bool TrackManager::loadParams(const TiXmlElement* root)
     397{
    400398  double x, y, z, d;
    401399
    402   element = root->FirstChildElement();
    403   while( element != NULL)
    404     {
     400  LOAD_PARAM_START_CYCLE
     401
    405402      LoadParam<TrackManager>(element, "WorkOn", this, &TrackManager::workOnS, true)
    406403        .describe("Selects a TrackElement (by name) to work on");
     
    448445        }
    449446      */
    450       element = element->NextSiblingElement();
    451     }
    452 
     447      LOAD_PARAM_END_CYCLE;
    453448}
    454449
  • orxonox/trunk/src/util/track/track_manager.h

    r4833 r4834  
    139139  inline static TrackManager* getInstance() { if (!singletonRef) singletonRef = new TrackManager();  return singletonRef; };
    140140
    141   bool loadParams(TiXmlElement* root);
     141  bool loadParams(const TiXmlElement* root);
    142142
    143143  // Methods to change the Path (initialisation)
Note: See TracChangeset for help on using the changeset viewer.