Changeset 8197 in orxonox.OLD for branches/script_engine/src/lib/lang
- Timestamp:
- Jun 7, 2006, 3:25:04 PM (18 years ago)
- Location:
- branches/script_engine/src/lib/lang
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/script_engine/src/lib/lang/class_list.cc
r7429 r8197 221 221 return (*bo); 222 222 } 223 } 224 return NULL; 225 } 226 227 228 /** 229 * @brief checks if the BaseObject* object exists. 230 * @param objectName the name of the BaseObject to look for 231 * @param classID if not CL_NULL it will only search through a specific type of Objects. Otherwise it will be searched everywhere. 232 * @return true, if the Object Exists in the specified ClassID, false otherwise 233 * @todo: speed this up!! 234 */ 235 BaseObject* ClassList::getObject(const std::string& objectName, const std::string& className) 236 { 237 ClassList* cl = ClassList::getClassList(className); 238 if (cl != NULL) 239 { 240 std::list<BaseObject*>::iterator bo; 241 for (bo = cl->objectList.begin(); bo != cl->objectList.end(); bo++) 242 if ((*bo)->getName() != NULL && objectName == (*bo)->getName()) 243 return (*bo); 223 244 } 224 245 return NULL; -
branches/script_engine/src/lib/lang/class_list.h
r7429 r8197 42 42 static const std::list<BaseObject*>* getList(const std::string& className); // { return (ClassList* fl = ClassList::getClassList(className) != NULL)? &(fl->objectList) : NULL; }; 43 43 static const std::list<std::string>* getClassNames(); 44 static BaseObject* getObject(const std::string& name, ClassID classID = CL_NULL); 44 static BaseObject* getObject(const std::string& objectName, ClassID classID = CL_NULL); 45 static BaseObject* getObject(const std::string& objectName, const std::string& className); 45 46 static bool exists(const BaseObject* object, ClassID classID = CL_NULL); 46 47 static bool exists(const std::string& className, const std::string& objectName);
Note: See TracChangeset
for help on using the changeset viewer.