Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 4, 2005, 1:39:32 PM (21 years ago)
Author:
bensch
Message:

orxonox/branches/parenting: added some more functionality, and wrote the [con|de]structors

File:
1 edited

Legend:

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

    r3330 r3331  
    1313
    1414#include "stdincl.h"
     15
     16
     17//! condition for choosing a certain Path. \todo implement a useful way.
     18struct PathCondition
     19{
     20 
     21};
     22 
     23
     24//! A Graph-Element, that holds the curve-structure of a Level.
     25/**
     26   A TrackElement is used, to define the structure of the Track itself.
     27   It is a graph and not a tree, because paths can fork and join again.
     28*/
     29class TrackElement
     30{
     31 public:
     32  TrackElement(void);
     33  ~TrackElement(void);
     34
     35  bool isSavePoint;          //!< If the first node is a savePoint
     36  bool isFork;               //!< If the first node is a Fork
     37  bool isJoined;             //!< If the End of the Curve is joined.
     38  PathCondition cond;        //!< The Split Condition;
     39  int ID;                    //!< The ID of this TrackElement
     40  float length;              //!< The time usedto cross this TrackElement (curve).
     41  CurveType curveType;       //!< The CurveType this will have.
     42  int nodeCount;             //!< The count of points this TrackElement has.
     43  Curve* curve;              //!< The Curve of this TrackElement
     44  int childCount;            //!< The number of Children This TrackElement has.
     45  TrackElement** children;   //!< A TrackElement can have a Tree of following TrackElements.
     46};
     47
    1548
    1649
     
    4275   
    4376   TrackManager can be handled as a StateMachine.
     77   \n\n
     78    Names:
     79    \li TrackManager: handles Tracks
     80    \li Track:        The Track that the ship can follow
     81    \li Path:         one way through the Level, that is dependent on conditionals.
     82    \li Conditional:  A decition making device, that chooses betwen different TrackElements for the Path.
     83    \li TrackElement: A Part of A whole Track
    4484*/
    45 class TrackManager : public BaseObject {
     85class TrackManager : public BaseObject
     86{
    4687 private:
    47   //! condition for choosing a certain Path. \todo implement a useful way.
    48   struct PathCondition
    49   {
    50    
    51   };
     88  TrackManager(void);
     89
     90  static TrackManager* singletonRef;  //!< There may only be one TrackManager existing.
     91  TrackElement* firstTrackElem;       //!< The first TrackElement that exists.
     92  TrackElement* currentTrackElem;       //!< The TrackElement we are working on.
     93  float localTime;                    //!< The time that has been passed since the traveling the Track.
     94  float maxTime;                      //!< The maximal time the track has.
     95  int trackElemCount;                 //!< The count of TrackElements that exist.
    5296 
    53   //! A Graph, that holds the curve-structure of a Level.
    54   /**
    55      A CurveGraph is used, to Define the structure of the Track itself.
    56      It is a graph and not a tree, because paths can fork and join again.
    57   */
    58   struct TrackElement
    59   {
    60     bool isSavePoint;          //!< If the first node is a savePoint
    61     bool isFork;               //!< If the first node is a Fork
    62     bool isJoined;             //!< If the End of the Curve is joined.
    63     PathCondition cond;        //!< The Split Condition;
    64     int ID;                    //!< The ID of this TrackElement
    65     float length;              //!< The time usedto cross this TrackElement (curve).
    66     CurveType curveType;       //!< The CurveType this will have.
    67     int nodeCount;             //!< The count of points this TrackElement has.
    68     Curve* curve;              //!< The Curve of this TrackElement
    69     TrackElement** children;   //!< A TrackElement can have a Tree of following TrackElements.
    70   };
    7197
    72 
    73   TrackElement* firstGraph;    //!< The first Graph-element we are on.
    74   TrackElement* currentGraph;  //!< The Graph-element we are working on.
    75   float localTime;             //!< The time that has been passed since the traveling the Track.
    76   int trackElementCount;       //!< The count of TrackElements that exist.
     98  TrackElement findTrackElementByID(int trackID);
    7799 
    78   TrackElement findTrackElementByID(int trackID);
    79100
    80101 public:
    81   TrackManager ();
    82   ~TrackManager ();
     102  ~TrackManager(void);
     103  static TrackManager* getInstance(void);
    83104
    84105  // Methods to change the Path (initialisation)
     
    99120  Vector calcDir();
    100121  void tick(float dt);
     122  void jumpTo(float time);
    101123  void choosePath(int graphID);
    102124
Note: See TracChangeset for help on using the changeset viewer.