Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3841 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Apr 16, 2005, 11:51:39 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: added a possibility to join tracks by name

Location:
orxonox/trunk/src
Files:
2 edited

Legend:

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

    r3840 r3841  
    707707
    708708/**
     709   \brief Joins some Tracks together again.
     710   \param count The count of trackElements to join
     711
     712   \see void TrackManager::join(unsigned int count, ...)
     713   The difference to void TrackManager::join(unsigned int count, ...) is, that this function takes
     714   the Names of the TrackElements as inputs and not their ID
     715*/
     716void TrackManager::joinc(unsigned int count, ...)
     717{
     718  int* trackIDs = new int [count];
     719  va_list NAME;
     720  va_start (NAME, count);
     721  for(int i = 0; i < count; i++)
     722    {
     723      char* name = va_arg (NAME, char*);
     724      TrackElement* tmpElem = this->firstTrackElem->findByName(name);
     725      if (tmpElem)
     726        trackIDs[i] = tmpElem->ID;
     727      else
     728        PRINTF(1)("Trying to join a Track, of which the name does not exist: %s\n", name);
     729    }
     730  va_end(NAME);
     731  this->joinV(count, trackIDs);
     732  delete []trackIDs;
     733}
     734
     735
     736/**
    709737   \brief joins some tracks together again.
    710738   \param count The count of Paths to join.
    711739   \param trackIDs an Array with the trackID's to join
    712740
    713    \see void TrackManager::join(int count, ...)
     741   \see void TrackManager::join(unsigned int count, ...)
    714742*/
    715743void TrackManager::joinV(unsigned int count, int* trackIDs)
  • orxonox/trunk/src/track_manager.h

    r3837 r3841  
    162162  void condition(CONDITION cond, void* subject, TrackElement* trackElem = NULL);
    163163  void join(unsigned int count, ...);
     164  void joinc(unsigned int count, ...);
    164165  void joinV(unsigned int count, int* trackIDs);
    165166  void finalize(void);
Note: See TracChangeset for help on using the changeset viewer.