Changeset 6142 in orxonox.OLD for trunk/src/util/object_manager.h
- Timestamp:
- Dec 16, 2005, 7:13:57 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/object_manager.h
r5795 r6142 1 1 /*! 2 2 * @file object_manager.h 3 * @brief Definition of the ... singleton Class4 */3 * @brief Definition of the ObjectManager. 4 */ 5 5 6 6 #ifndef _OBJECT_MANAGER_H … … 9 9 #include "base_object.h" 10 10 #include <list> 11 #include <vector> 12 13 /// Enumerator for Managed Object Lists 14 typedef enum { 15 OM_NULL = 0, 16 OM_DEAD, 17 OM_DEAD_TICK, 18 OM_ENVIRON_NOTICK, 19 OM_ENVIRON, 20 OM_COMMON, 21 22 OM_GROUP_00, 23 OM_GROUP_00_PROJ, 24 OM_GROUP_01, 25 OM_GROUP_01_PROJ, 26 OM_GROUP_02, 27 OM_GROUP_02_PROJ, 28 OM_GROUP_03, 29 OM_GROUP_03_PROJ, 30 OM_GROUP_04, 31 OM_GROUP_04_PROJ, 32 OM_GROUP_05, 33 OM_GROUP_05_PROJ, 34 OM_GROUP_06, 35 OM_GROUP_06_PROJ, 36 OM_GROUP_07, 37 OM_GROUP_07_PROJ, 38 OM_GROUP_08, 39 OM_GROUP_08_PROJ, 40 OM_GROUP_09, 41 OM_GROUP_09_PROJ, 42 OM_GROUP_10, 43 OM_GROUP_10_PROJ, 44 OM_GROUP_11, 45 OM_GROUP_11_PROJ, 46 OM_GROUP_12, 47 OM_GROUP_12_PROJ, 48 OM_GROUP_13, 49 OM_GROUP_13_PROJ, 50 OM_GROUP_14, 51 OM_GROUP_14_PROJ, 52 OM_GROUP_15, 53 OM_GROUP_15_PROJ, 54 55 OM_SIZE, 56 57 58 OM_INIT = -1, //!< DO NOT USE THIS. (WorldEntity Internal). 59 } OM_LIST; 60 61 #define OM_DEFAULT_LIST OM_NULL 62 11 63 12 64 // FORWARD DECLARATION … … 14 66 class WorldEntity; 15 67 16 class ObjectGroupList 17 { 18 19 20 21 }; 22 23 24 //! A default singleton class. 68 //! A powerfull handler for the Object (WorldEntities) in the World. 25 69 class ObjectManager : public BaseObject { 26 70 27 71 public: 28 virtual ~ObjectManager(void); 29 /** @returns a Pointer to the only object of this Class */ 30 inline static ObjectManager* getInstance(void) { if (!ObjectManager::singletonRef) ObjectManager::singletonRef = new ObjectManager(); return ObjectManager::singletonRef; }; 72 ObjectManager(); 73 virtual ~ObjectManager(); 31 74 75 void flush(); 76 77 void toList (WorldEntity* entity, OM_LIST omList = OM_DEFAULT_LIST); 78 void toList (WorldEntity* entity, const char* omList); 79 80 81 std::list<WorldEntity*>& getObjectList(OM_LIST listNumber) { return this->objectLists[listNumber]; } 82 const std::list<WorldEntity*>& getObjectList(OM_LIST listNumber) const { return this->objectLists[listNumber]; } 32 83 33 84 static std::list<WorldEntity*>* distanceFromObject(const PNode& center, float radius, ClassID classID); 34 85 35 ObjectGroupList* getGroupList( ); 86 void debug(OM_LIST omList, unsigned int level = 0) const; 87 void debug(const char* listName = NULL, unsigned int level = 0); 88 89 static OM_LIST StringToOMList(const char* listName); 90 static const char* OMListToString(OM_LIST omList); 36 91 37 92 private: 38 ObjectManager(void); 39 static ObjectManager* singletonRef; 40 41 std::list<ObjectGroupList> groupList; 42 43 const std::list<BaseObject>* pNodeList; 93 const std::list<BaseObject>* pNodeList; 44 94 45 95 96 std::list<WorldEntity*> objectLists[OM_SIZE]; 97 98 static const char* objectManagerListNames[]; //!< Names of all the lists 46 99 }; 47 100
Note: See TracChangeset
for help on using the changeset viewer.