/*! \file object_manager.h \brief this manager will ceep track of the objects in the world This is specially designed to: - Give an interface to the world data - separate the world data from the world build,update,draw process - recycle deleted objects: specific for Projectils since there is a lot of world entity creation/deletion (and this needs a lot of time) - control the garbage collector */ #ifndef _OBJECT_MANAGER_H #define _OBJECT_MANAGER_H #include "base_object.h" #define OM_ class WorldEntity; //! list of classes able to be loaded via the object manager struct classListElement { char* name; }; #include "class_list.h" template class tList; template class ManagedObject; //! the object manager itself class ObjectManager : public BaseObject { public: static ObjectManager* getInstance(void); virtual ~ObjectManager(void); void cache(classList index, int number, const BaseObject ©Object); void addToDeadList(const char* className, BaseObject* object); BaseObject* getFromDeadList(const char* className, int number = 1); private: ObjectManager(void); static ObjectManager* singletonRef; //BaseObject** managedObjectList; tList** managedObjectList; }; template class ManagedObject { public: const char* className; tList* objectList; }; #define createClassFromName(className) #endif /* _OBJECT_MANAGER_H */