Changeset 4508 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Jun 4, 2005, 2:29:11 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/util/list.h
r4500 r4508 110 110 int getSize(); 111 111 //T* enumerate(); 112 bool inList(T* entity); 112 113 tIterator<T>* getIterator(); 113 114 T* nextElement(T* toEntity); … … 258 259 } 259 260 261 /** 262 \brief checks if an entity is in the List 263 \param entity The entity to check for in the entire List. 264 \returns true if it is, false otherwise 265 */ 266 template<class T> 267 inline bool tList<T>::inList(T* entity) 268 { 269 // pre checks 270 if(this->size == 0) return false; 271 if( entity == NULL) return false; 272 273 // search in the List 274 this->currentEl = this->first; 275 while(this->currentEl->curr != entity && this->currentEl != NULL) 276 this->currentEl = this->currentEl->next; 277 278 // post checks 279 if(this->currentEl == NULL) 280 return false; 281 else 282 return true; 283 } 260 284 261 285 /**
Note: See TracChangeset
for help on using the changeset viewer.