Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3335 in orxonox.OLD for orxonox/branches/parenting


Ignore:
Timestamp:
Jan 5, 2005, 1:49:13 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches/parenting: added TrackManager to world.cc. (just the constructor), and moved some functions.

Location:
orxonox/branches/parenting/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/parenting/src/track_manager.cc

    r3333 r3335  
    6464
    6565/**
    66    \brief reserves Space for childCount children
    67    \param childCount The Count of children to make space for.
    68 */
    69 void TrackElement::initChildren(unsigned int childCount)
    70 {
    71   this->childCount = childCount;
    72   this->children = new TrackElement*[childCount];
    73   for (int i=0; i<childCount; i++)
    74     this->children[i] = new TrackElement();
    75 }
    76 
    77 /**
    7866   \brief Searches through all the TrackElements for trackID.
    7967   \param trackID The ID to search for.
     
    10896   \brief standard constructor
    10997
    110    \todo this constructor is not jet implemented - do it
    11198*/
    11299TrackManager::TrackManager ()
     
    115102
    116103  PRINTF(3)("Initializing the TrackManager\n");
    117   this->firstTrackElem = NULL;
     104  this->firstTrackElem = new TrackElement;
    118105  this->currentTrackElem = firstTrackElem;
    119106  this->localTime = 0;
     
    126113   \brief standard destructor
    127114
    128    \todo this deconstructor is not jet implemented - do it
    129115*/
    130116TrackManager::~TrackManager ()
     
    134120  PRINTF(3)("Deleting all the TrackElements\n");
    135121  delete this->firstTrackElem;
     122
    136123  // we do not have a TrackManager anymore
    137124  singletonRef = NULL;
     
    151138  else
    152139    return singletonRef = new TrackManager();
     140}
     141
     142/**
     143   \brief reserves Space for childCount children
     144   \param childCount The Count of children to make space for.
     145*/
     146void TrackManager::initChildren(unsigned int childCount)
     147{
     148  trackElemCount = 0;
     149  this->currentTrackElem->childCount = childCount;
     150  this->currentTrackElem->children = new TrackElement*[childCount];
     151  for (int i=0; i<childCount; i++)
     152    this->currentTrackElem->children[i] = new TrackElement();
    153153}
    154154
     
    251251  this->currentTrackElem->isSavePoint = true;
    252252
    253   this->currentTrackElem->initChildren(1);
     253  this->initChildren(1);
    254254}
    255255
     
    290290  this->currentTrackElem->isFork = true;
    291291
    292   this->currentTrackElem->initChildren(count);
     292  this->initChildren(count);
    293293}
    294294
  • orxonox/branches/parenting/src/track_manager.h

    r3333 r3335  
    3232  TrackElement(void);
    3333  ~TrackElement(void);
    34 
    35   void initChildren(unsigned int childCount);
    3634
    3735  TrackElement* findByID(unsigned int trackID);
     
    103101  int trackElemCount;                 //!< The count of TrackElements that exist.
    104102 
     103  void initChildren(unsigned int childCount);
    105104
    106105  TrackElement* findTrackElementByID(unsigned int trackID) const;
  • orxonox/branches/parenting/src/world.cc

    r3334 r3335  
    1818#include "world_entity.h"
    1919#include "collision.h"
     20#include "track_manager.h"
    2021#include "track.h"
    2122#include "player.h"
     
    143144  if(this->debugWorldNr != -1)
    144145    {
     146      trackManager = TrackManager::getInstance();
    145147      switch(this->debugWorldNr)
    146148        {
  • orxonox/branches/parenting/src/world.h

    r3327 r3335  
    1111
    1212
    13 
     13class TrackManager;
    1414class Track;
    1515class WorldEntity;
     
    6161 
    6262  // base level data
     63  TrackManager* trackManager;
    6364  Track* track;
    6465  Uint32 tracklen;   // number of Tracks the World consist of
Note: See TracChangeset for help on using the changeset viewer.