/*! * @file object_manager.h * @brief Definition of the ObjectManager. */ #ifndef _OBJECT_MANAGER_H #define _OBJECT_MANAGER_H #include "base_object.h" #include #include /// Enumerator for Managed Object Lists typedef enum { OM_NULL = 0, OM_DEAD, OM_DEAD_TICK, OM_ENVIRON_NOTICK, OM_ENVIRON, OM_COMMON, OM_GROUP_00, OM_GROUP_00_PROJ, OM_GROUP_01, OM_GROUP_01_PROJ, OM_GROUP_02, OM_GROUP_02_PROJ, OM_GROUP_03, OM_GROUP_03_PROJ, OM_GROUP_04, OM_GROUP_04_PROJ, OM_GROUP_05, OM_GROUP_05_PROJ, OM_GROUP_06, OM_GROUP_06_PROJ, OM_GROUP_07, OM_GROUP_07_PROJ, OM_GROUP_08, OM_GROUP_08_PROJ, OM_GROUP_09, OM_GROUP_09_PROJ, OM_GROUP_10, OM_GROUP_10_PROJ, OM_GROUP_11, OM_GROUP_11_PROJ, OM_GROUP_12, OM_GROUP_12_PROJ, OM_GROUP_13, OM_GROUP_13_PROJ, OM_GROUP_14, OM_GROUP_14_PROJ, OM_GROUP_15, OM_GROUP_15_PROJ, OM_SIZE, OM_INIT = -1, //!< DO NOT USE THIS. (WorldEntity Internal). } OM_LIST; #define OM_DEFAULT_LIST OM_NULL // FORWARD DECLARATION class PNode; class WorldEntity; //! A powerfull handler for the Object (WorldEntities) in the World. class ObjectManager : public BaseObject { public: ObjectManager(); virtual ~ObjectManager(); void flush(); void toList (WorldEntity* entity, OM_LIST omList = OM_DEFAULT_LIST); void toList (WorldEntity* entity, const char* omList); std::list& getObjectList(OM_LIST listNumber) { return this->objectLists[listNumber]; } const std::list& getObjectList(OM_LIST listNumber) const { return this->objectLists[listNumber]; } static std::list* distanceFromObject(const PNode& center, float radius, ClassID classID); void debug(OM_LIST omList, unsigned int level = 0) const; void debug(const char* listName = NULL, unsigned int level = 0); static OM_LIST StringToOMList(const char* listName); static const char* OMListToString(OM_LIST omList); private: const std::list* pNodeList; std::list objectLists[OM_SIZE]; static const char* objectManagerListNames[]; //!< Names of all the lists }; #endif /* _OBJECT_MANAGER_H */