Changeset 7403 in orxonox.OLD for trunk/src/lib/lang
- Timestamp:
- Apr 27, 2006, 5:49:12 PM (19 years ago)
- Location:
- trunk/src/lib/lang
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/lang/class_list.cc
r7396 r7403 249 249 if (cl != NULL) 250 250 { 251 std::list<BaseObject*>::const_iterator bo = find (cl->objectList.begin(), cl->objectList.end(), object);251 std::list<BaseObject*>::const_iterator bo = std::find (cl->objectList.begin(), cl->objectList.end(), object); 252 252 return (bo != cl->objectList.end()); 253 253 } … … 258 258 for (cl = ClassList::classList->begin(); cl != ClassList::classList->end(); cl++) 259 259 { 260 std::list<BaseObject*>::const_iterator bo = find ((*cl).objectList.begin(), (*cl).objectList.end(), object);260 std::list<BaseObject*>::const_iterator bo = std::find ((*cl).objectList.begin(), (*cl).objectList.end(), object); 261 261 if (bo != (*cl).objectList.end()) 262 262 return true; … … 265 265 return false; 266 266 } 267 268 bool ClassList::exists(const std::string& className, const std::string& objectName) 269 { 270 ClassList* cl = ClassList::getClassList(className); 271 if (likely(cl != NULL)) 272 { 273 std::list<BaseObject*>::iterator bo; 274 for (bo = cl->objectList.begin(); bo != cl->objectList.end(); bo++) 275 if ((*bo)->getName() != NULL && objectName == (*bo)->getName()) 276 return true; 277 } 278 return false; 279 } 280 267 281 268 282 /** -
trunk/src/lib/lang/class_list.h
r7221 r7403 47 47 static BaseObject* getObject(const std::string& name, ClassID classID = CL_NULL); 48 48 static bool exists(const BaseObject* object, ClassID classID = CL_NULL); 49 static bool exists(const std::string& className, const std::string& objectName); 49 50 50 51 void sendBack(std::list<BaseObject*>::const_iterator it);
Note: See TracChangeset
for help on using the changeset viewer.