Changeset 9703 in orxonox.OLD for branches/new_class_id/src/util/object_manager.cc
- Timestamp:
- Aug 25, 2006, 12:11:45 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/util/object_manager.cc
r9656 r9703 17 17 18 18 #include "object_manager.h" 19 #include "class_list.h"20 19 21 20 #include "world_entity.h" … … 30 29 ->defaultValues("", 0); 31 30 31 NewObjectListDefinition(ObjectManager); 32 32 /** 33 33 * @brief standard constructor … … 35 35 ObjectManager::ObjectManager () 36 36 { 37 this->setClassID(CL_OBJECT_MANAGER, "ObjectManager");37 this->registerObject(this, ObjectManager::_objectList); 38 38 this->setName("ObjectManager"); 39 39 … … 63 63 { 64 64 for (unsigned int i = 0; i < OM_SIZE; ++i) 65 while(!this-> objectLists[i].empty())66 delete this-> objectLists[i].front();65 while(!this->entityLists[i].empty()) 66 delete this->entityLists[i].front(); 67 67 68 68 // delete reflection list … … 83 83 84 84 if (likely(entity->getOMListNumber() != OM_INIT)) 85 this-> objectLists[entity->getOMListNumber()].erase(entity->getEntityIterator());85 this->entityLists[entity->getOMListNumber()].erase(entity->getEntityIterator()); 86 86 87 87 if (likely(omList != OM_INIT)) 88 88 { 89 this-> objectLists[omList].push_back(entity);90 entity->getEntityIterator() = --this-> objectLists[omList].end();89 this->entityLists[omList].push_back(entity); 90 entity->getEntityIterator() = --this->entityLists[omList].end(); 91 91 entity->getOMListNumber() = omList; 92 92 } … … 111 111 * @returns a new List with a list of WorldEntities of distance Radius from center 112 112 */ 113 void ObjectManager::distanceFromObject(EntityList& entities, const PNode& center, float radius, ClassID classID) 114 { 115 const std::list<BaseObject*>* objectList = ClassList::getList(classID); 116 if (objectList != NULL) 113 /* 114 void ObjectManager::distanceFromObject(EntityList& entities, const PNode& center, float radius, const NewClassID& classID) 115 { 116 TODO FIXME 117 118 const std::list<BaseObject*>* entityList = ClassList::getList(classID); 119 if (entityList != NULL) 117 120 { 118 121 119 122 std::list<BaseObject*>::const_iterator node; 120 for (node = objectList->begin(); node != objectList->end(); node++)123 for (node = entityList->begin(); node != entityList->end(); node++) 121 124 if ((dynamic_cast<PNode*>(*node)->getAbsCoor() - center.getAbsCoor()).len() < radius) 122 125 entities.push_back(dynamic_cast<WorldEntity*>(*node)); 123 126 } 124 127 } 128 */ 125 129 126 130 … … 134 138 if (omList != OM_INIT || omList == OM_SIZE) 135 139 { 136 PRINT(0)(" +ObjectManager-LIST: '%s'==size='%d'==---\n", ObjectManager::OMListToString((OM_LIST)omList).c_str(), this-> objectLists[omList].size());140 PRINT(0)(" +ObjectManager-LIST: '%s'==size='%d'==---\n", ObjectManager::OMListToString((OM_LIST)omList).c_str(), this->entityLists[omList].size()); 137 141 // if (level >= 1) 138 142 { 139 143 ObjectManager::EntityList::const_iterator entity; 140 for (entity = this-> objectLists[omList].begin(); entity != this->objectLists[omList].end(); entity++)144 for (entity = this->entityLists[omList].begin(); entity != this->entityLists[omList].end(); entity++) 141 145 { 142 146 PRINT(0)(" | %s::%s\n",(*entity)->getClassCName(), (*entity)->getCName());
Note: See TracChangeset
for help on using the changeset viewer.