/*! \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_ //! list of all classes to be loadable in via the ObjectManager typedef enum classList { CL_PROJECTILE, CL_TEST_BULLET, CL_NUMBER }; class WorldEntity; class GarbageCollector; class Projectile; template class tList; template class ManagedObject; #define mCache( Class ) \ cache(classList index, int number, Class * copyObject) //! the object manager itself class ObjectManager : public BaseObject { public: static ObjectManager* getInstance(void); virtual ~ObjectManager(void); void mCache(Projectile); void addToDeadList(classList index, BaseObject* object); BaseObject* getFromDeadList(classList index, int number = 1); void debug(); private: ObjectManager(void); //void cache(classList index, int number, Projectile* copyObject); static ObjectManager* singletonRef; //BaseObject** managedObjectList; tList** managedObjectList; GarbageCollector* garbageCollector; }; #endif /* _OBJECT_MANAGER_H */