Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3522 in orxonox.OLD for orxonox/trunk/src/track_manager.h


Ignore:
Timestamp:
Mar 13, 2005, 12:05:07 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the important files of the trackManager to the trunk
It was not anymore possible to merge.

this is not so big a problem, as I only coded inside the track_manager, track_node files. But it will be if we try to merge other branches back to the trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/track_manager.h

    r3495 r3522  
    1717class PNode;
    1818
    19 //! condition for choosing a certain Path. \todo implement a useful way.
    20 struct PathCondition
    21 {
    22  
    23 };
    24  
    25 
    2619//! A Graph-Element, that holds the curve-structure of a Level.
    2720/**
     
    3629
    3730  TrackElement* findByID(unsigned int trackID);
     31  bool backLoopCheck(TrackElement* trackElem);
    3832
    3933  bool isFresh;              //!< If no Points where added until now
     
    4337  bool isJoined;             //!< If the End of the Curve is joined.
    4438  bool mainJoin;             //!< If the End of the Curve is joined, and this is the one Curve the others join to.
    45   PathCondition cond;        //!< The Split Condition;
    4639  int ID;                    //!< The ID of this TrackElement
    4740  float startingTime;        //!< The time at which this Track begins.
     
    5548  int childCount;            //!< The number of Children This TrackElement has.
    5649  TrackElement** children;   //!< A TrackElement can have a Tree of following TrackElements.
     50
     51  // CONDITION FUNCTIONS and STUFF
     52  void* subject;             //!< The Subject the Condition should act upon.
     53  int (TrackElement::*condFunc)(void*); //!< Pointer to the condition function
     54
     55  int lowest(void* nothing);
     56  int highest(void* nothing);
     57  int random(void* nothing);
     58
     59  int leftRight(void* node);
     60  int nearest(void* node);
     61  // todo  int enemyKilled(void* entity);
    5762};
    5863
    59 
     64//! the Condition to choose between the different ways of the game.
     65enum CONDITION {LOWEST, HIGHEST, RANDOM, LEFTRIGHT, NEAREST, ENEMYKILLED};
    6066
    6167//! The TrackManager handles the flow of the Players through the game.
     
    105111  float maxTime;                      //!< The maximal time the track has.
    106112  int trackElemCount;                 //!< The count of TrackElements that exist.
    107   PNode* bindSlave;
     113  PNode* bindSlave;                   //!< The node that is slave to the TrackManager. This node will be moved while update the TrackManager, and must NOT move itself.
    108114 
    109115  void initChildren(unsigned int childCount);
     
    117123  // Methods to change the Path (initialisation)
    118124  void workOn(unsigned int trackID);
    119   inline void setCurveType(CurveType curveType) { this->setCurveType (curveType, this->currentTrackElem);}
     125  /** \see setCurveType(CurveType curveType, TrackElement* trackElem); \param curveType the type of the Curve */
     126  inline void setCurveType(CurveType curveType) { this->setCurveType (curveType, this->currentTrackElem);};
    120127  void setCurveType(CurveType curveType, TrackElement* trackElem);
    121128  void setDuration(float time);
     
    126133  void fork(unsigned int count, ...);
    127134  void forkV(unsigned int count, int* trackIDs);
    128   void condition(unsigned int groupID, PathCondition cond); //!< \todo really do this!!
     135  void condition(CONDITION cond, void* subject);
     136  void condition(unsigned int groupID, CONDITION cond, void* subject);
    129137  void join(unsigned int count, ...);
    130138  void joinV(unsigned int count, int* trackIDs);
     
    132140
    133141  // Methods to calculate the position on the Path (runtime)
    134   Vector calcPos(void) const;
    135   Vector calcDir(void) const;
     142  inline Vector calcPos(void) const;
     143  inline Vector calcDir(void) const;
    136144  void tick(float dt);
    137145  void jumpTo(float time);
    138   void choosePath(int graphID);
     146  inline int choosePath(TrackElement* trackElem);
    139147
    140148  void setBindSlave(PNode* bindSlave);
Note: See TracChangeset for help on using the changeset viewer.