Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4792 in orxonox.OLD


Ignore:
Timestamp:
Jul 6, 2005, 12:24:00 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: Array::getIndex(element) implemented - this will look up an entry and return its index if found -1 else.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/importer/array.h

    r4791 r4792  
    159159int Array<T>::getIndex(T* entry) const
    160160{
     161  if( unlikely(this->finalized == false))
     162    return -1;
    161163
     164  for(int i = 0; i < this->entryCount; ++i)
     165  {
     166    if( unlikely(entry == &this->array[i]))
     167      return i;
     168  }
    162169}
    163170
Note: See TracChangeset for help on using the changeset viewer.