Changeset 6091 in orxonox.OLD for branches/objectmanager
- Timestamp:
- Dec 13, 2005, 4:56:23 PM (19 years ago)
- Location:
- branches/objectmanager/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/objectmanager/src/defs/debug.h
r5996 r6091 110 110 #endif 111 111 #ifndef NO_SHELL 112 #define PRINT_EXEC printf //ShellBuffer::addBufferLineStatic112 #define PRINT_EXEC ShellBuffer::addBufferLineStatic 113 113 #else /* NO_SHELL */ 114 114 #define PRINT_EXEC printf -
branches/objectmanager/src/util/object_manager.cc
r6089 r6091 10 10 11 11 ### File Specific: 12 main-programmer: ...12 main-programmer: Benjamin Grauer 13 13 co-programmer: ... 14 14 */ … … 21 21 #include "world_entity.h" 22 22 23 #include "shell_command.h" 23 24 using namespace std; 24 25 SHELL_COMMAND(debug, ObjectManager, debug) 26 ->defaultValues(2, NULL, 0); 25 27 26 28 /** … … 63 65 if (likely(omList != OM_INIT)) 64 66 { 65 this->objectList[omList].push_back(entity); 67 this->objectLists[omList].push_back(entity); 68 entity->getEntityIterator() = --this->objectLists[omList].end(); 66 69 entity->getOMListNumber() = omList; 67 70 } … … 78 81 void ObjectManager::toList (WorldEntity* entity, const char* omList) 79 82 { 80 this->toList(entity, ObjectManager::StringToOMList( 83 this->toList(entity, ObjectManager::StringToOMList(omList)); 81 84 } 82 85 … … 103 106 104 107 108 /** 109 * @brief print out nice debug information about Elements in the list OM_LIST 110 * @param omList the List to debug. 111 */ 112 void ObjectManager::debug(OM_LIST omList) const 113 { 114 if (omList != OM_INIT) 115 { 116 PRINT(0)(" +ObjectManager-LIST: '%s'------\n", ObjectManager::OMListToString((OM_LIST) omList)); 117 std::list<WorldEntity*>::const_iterator entity; 118 for (entity = this->objectLists[omList].begin(); entity != this->objectLists[omList].end(); entity++) 119 { 120 PRINT(0)(" | %s::%s\n",(*entity)->getClassName(), (*entity)->getName()); 121 } 122 } 123 else 124 PRINTF(2)("Invalid query. for OM_INIT-LIST\n"); 125 } 126 127 128 /** 129 * @brief prints out very nice debug information 130 * @param listName the Name of the list to get Debug information from 131 */ 132 void ObjectManager::debug(const char* listName) 133 { 134 PRINT(0)("=ObjectManager-DEBUG=============\n"); 135 if (listName == NULL || listName[0] == '\0') 136 for (unsigned int i = 0; i < OM_SIZE; ++i) 137 debug((OM_LIST) i); 138 else 139 debug(ObjectManager::StringToOMList(listName)); 140 PRINT(0)("=========================== OM ==\n"); 141 } 105 142 106 143 … … 111 148 * @returns the String transformed from omList. 112 149 */ 113 const char* ObjectManager:: StringToOMList(OM_LIST omList)150 const char* ObjectManager::OMListToString(OM_LIST omList) 114 151 { 115 152 switch (omList) -
branches/objectmanager/src/util/object_manager.h
r6089 r6091 83 83 static std::list<WorldEntity*>* distanceFromObject(const PNode& center, float radius, ClassID classID); 84 84 85 void debug(OM_LIST omList) const; 86 void debug(const char* listName = NULL); 85 87 86 88 static OM_LIST StringToOMList(const char* listName); 87 static const char* StringToOMList(OM_LIST omList);89 static const char* OMListToString(OM_LIST omList); 88 90 89 91 private:
Note: See TracChangeset
for help on using the changeset viewer.