Index: /orxonox/branches/parenting/src/curve.h
===================================================================
--- /orxonox/branches/parenting/src/curve.h	(revision 3330)
+++ /orxonox/branches/parenting/src/curve.h	(revision 3331)
@@ -13,5 +13,5 @@
 
 //! An Enumerator that defines what sort of Curves are availible
-enum CurveType {BEZIER, UPOINT};
+enum CurveType {BEZIERCURVE, UPOINTCURVE};
 
 
Index: /orxonox/branches/parenting/src/track_manager.cc
===================================================================
--- /orxonox/branches/parenting/src/track_manager.cc	(revision 3330)
+++ /orxonox/branches/parenting/src/track_manager.cc	(revision 3331)
@@ -22,4 +22,39 @@
 using namespace std;
 
+/**
+   \brief initializes a TrackElement (sets the default values)
+*/
+TrackElement::TrackElement(void)
+{
+  this->isSavePoint = false;
+  this->isFork = false;
+  this->isJoined = false;
+  this->cond; //!< todo think!!
+  this->ID = -1;
+  this->length =0;
+  this->curveType = BEZIERCURVE;
+  this->nodeCount = 0;
+  childCount = 0;
+  this->curve = NULL;
+  this->children = NULL;
+}
+
+/** 
+    \destroys all alocated memory)
+    \todo eventually when deleting a TrackElement you would not like to delete all its preceding TrackElements
+*/
+TrackElement::~TrackElement(void)
+{
+  if (this->curve)
+    delete this->curve;
+  if (this->childCount > 0)
+    {
+      for (int i=0; i < this->childCount; i++)
+	delete this->children[i];
+    }
+}
+
+
+
 
 /**
@@ -30,10 +65,17 @@
 TrackManager::TrackManager () 
 {
-   this->setClassName ("TrackManager");
-}
-
-
-/**
-   \brief standard deconstructor
+  this->setClassName ("TrackManager");
+
+  PRINTF(3)("Initializing the TrackManager\n");
+  this->firstTrackElem = NULL;
+  this->currentTrackElem = firstTrackElem;
+  this->localTime = 0;
+  this->maxTime = 0;
+  this->trackElemCount = 0;
+}
+
+
+/**
+   \brief standard destructor
 
    \todo this deconstructor is not jet implemented - do it
@@ -41,5 +83,25 @@
 TrackManager::~TrackManager () 
 {
-
+  PRINTF(3)("Destruct TrackManager\n");
+
+  PRINTF(3)("Deleting all the TrackElements\n");
+  delete this->firstTrackElem;
+  // we do not have a TrackManager anymore
+  singletonRef = NULL;
+}
+
+TrackManager* TrackManager::singletonRef = NULL;
+
+/**
+   \returns The reference on the TrackManager.
+
+   If the TrackManager does not exist, it will be created.
+*/
+TrackManager* TrackManager::getInstance(void) 
+{
+  if (singletonRef)
+    return singletonRef;
+  else
+    return singletonRef = new TrackManager();
 }
 
@@ -201,4 +263,16 @@
 
 /**
+   \brief Jumps to a certain point on the Track.
+   \param time The time on the Track to jump to.
+
+   This should be used to Jump backwards on a Track, because moving forward means to change between the Path. (it then tries to choose the default.)
+   Max is trackLengthMax.
+*/
+void TrackManager::jumpTo(float time)
+{
+
+}
+
+/**
    \brief a Function that decides which Path we should follow.
    \param graphID The Path to choose.
Index: /orxonox/branches/parenting/src/track_manager.h
===================================================================
--- /orxonox/branches/parenting/src/track_manager.h	(revision 3330)
+++ /orxonox/branches/parenting/src/track_manager.h	(revision 3331)
@@ -13,4 +13,37 @@
 
 #include "stdincl.h"
+
+
+//! condition for choosing a certain Path. \todo implement a useful way.
+struct PathCondition
+{
+  
+};
+  
+
+//! A Graph-Element, that holds the curve-structure of a Level.
+/**
+   A TrackElement is used, to define the structure of the Track itself.
+   It is a graph and not a tree, because paths can fork and join again.
+*/
+class TrackElement
+{
+ public:
+  TrackElement(void);
+  ~TrackElement(void);
+
+  bool isSavePoint;          //!< If the first node is a savePoint
+  bool isFork;               //!< If the first node is a Fork
+  bool isJoined;             //!< If the End of the Curve is joined.
+  PathCondition cond;        //!< The Split Condition;
+  int ID;                    //!< The ID of this TrackElement
+  float length;              //!< The time usedto cross this TrackElement (curve).
+  CurveType curveType;       //!< The CurveType this will have.
+  int nodeCount;             //!< The count of points this TrackElement has.
+  Curve* curve;              //!< The Curve of this TrackElement
+  int childCount;            //!< The number of Children This TrackElement has.
+  TrackElement** children;   //!< A TrackElement can have a Tree of following TrackElements.
+};
+
 
 
@@ -42,43 +75,31 @@
    
    TrackManager can be handled as a StateMachine.
+   \n\n
+    Names: 
+    \li TrackManager: handles Tracks
+    \li Track:        The Track that the ship can follow
+    \li Path:         one way through the Level, that is dependent on conditionals.
+    \li Conditional:  A decition making device, that chooses betwen different TrackElements for the Path.
+    \li TrackElement: A Part of A whole Track
 */
-class TrackManager : public BaseObject {
+class TrackManager : public BaseObject
+{
  private:
-  //! condition for choosing a certain Path. \todo implement a useful way.
-  struct PathCondition
-  {
-    
-  };
+  TrackManager(void);
+
+  static TrackManager* singletonRef;  //!< There may only be one TrackManager existing.
+  TrackElement* firstTrackElem;       //!< The first TrackElement that exists.
+  TrackElement* currentTrackElem;       //!< The TrackElement we are working on.
+  float localTime;                    //!< The time that has been passed since the traveling the Track.
+  float maxTime;                      //!< The maximal time the track has.
+  int trackElemCount;                 //!< The count of TrackElements that exist.
   
-  //! A Graph, that holds the curve-structure of a Level.
-  /**
-     A CurveGraph is used, to Define the structure of the Track itself.
-     It is a graph and not a tree, because paths can fork and join again.
-  */
-  struct TrackElement
-  {
-    bool isSavePoint;          //!< If the first node is a savePoint
-    bool isFork;               //!< If the first node is a Fork
-    bool isJoined;             //!< If the End of the Curve is joined.
-    PathCondition cond;        //!< The Split Condition;
-    int ID;                    //!< The ID of this TrackElement
-    float length;              //!< The time usedto cross this TrackElement (curve).
-    CurveType curveType;       //!< The CurveType this will have.
-    int nodeCount;             //!< The count of points this TrackElement has.
-    Curve* curve;              //!< The Curve of this TrackElement
-    TrackElement** children;   //!< A TrackElement can have a Tree of following TrackElements.
-  };
 
-
-  TrackElement* firstGraph;    //!< The first Graph-element we are on.
-  TrackElement* currentGraph;  //!< The Graph-element we are working on.
-  float localTime;             //!< The time that has been passed since the traveling the Track.
-  int trackElementCount;       //!< The count of TrackElements that exist.
+  TrackElement findTrackElementByID(int trackID);
   
-  TrackElement findTrackElementByID(int trackID);
 
  public:
-  TrackManager ();
-  ~TrackManager ();
+  ~TrackManager(void);
+  static TrackManager* getInstance(void);
 
   // Methods to change the Path (initialisation)
@@ -99,4 +120,5 @@
   Vector calcDir();
   void tick(float dt);
+  void jumpTo(float time);
   void choosePath(int graphID);
 
