Index: orxonox/trunk/src/util/garbage_collector.cc
===================================================================
--- orxonox/trunk/src/util/garbage_collector.cc	(revision 4937)
+++ orxonox/trunk/src/util/garbage_collector.cc	(revision 4938)
@@ -18,5 +18,5 @@
 #include "garbage_collector.h"
 
-#include "world.h"
+#include "state.h"
 #include "world_entity.h"
 #include "null_parent.h"
@@ -39,5 +39,5 @@
 
    this->time = 0;
-   this->delay = 1.5f; /* clean up all 5.0 seconds */
+   this->delay = 5.0f; /* clean up all 5.0 seconds */
 }
 
@@ -104,6 +104,6 @@
   PRINTF(3)("=============================\n");
   int counter = 0;
-  WorldInterface* wi = WorldInterface::getInstance();
-  tList<WorldEntity>* list = wi->getEntityList();
+
+  tList<WorldEntity>* list = State::getWorldEntityList();
 
   tIterator<WorldEntity>* iterator = list->getIterator();
@@ -121,5 +121,6 @@
           entity->remove();
           /* then finaly delete reference */
-          delete entity;
+          //delete entity;
+          //FastFactory::kill();
           //ObjectManager::getInstance()->addToDeadList(entity->getClassID() & CL_MASK_LOWLEVEL_CLASS, entity);
         }
Index: orxonox/trunk/src/util/object_manager.cc
===================================================================
--- orxonox/trunk/src/util/object_manager.cc	(revision 4937)
+++ orxonox/trunk/src/util/object_manager.cc	(revision 4938)
@@ -23,9 +23,9 @@
 using namespace std;
 
-
-
-
-/**
- *  constructor, sets everything to zero and define factoryName
+/**
+ * Initializes a FastFactory
+ * @param classID the ClassID this Class belongs to (the top-most)
+ * @param fastFactoryName the Name of the ObjectClass-handled here
+ * @return a new FastFactory
  */
 FastFactory::FastFactory (ClassID classID, const char* fastFactoryName)
@@ -50,5 +50,5 @@
 /**
  *  destructor
- *  clear the Q
+ * deletes all the Instances of the FastFactory.
  */
 FastFactory::~FastFactory ()
@@ -61,4 +61,10 @@
 }
 
+/**
+ * registers a Factory to the List of known factories.
+ * @param fastFactory The factory to add
+ *
+ * needed, to step through all the FastFactories.
+ */
 void FastFactory::registerFastFactory(FastFactory* fastFactory)
 {
@@ -101,5 +107,6 @@
 
 /**
- *
+ * Removes all the stored Containers, and sets the Lists back to emptienes.
+ * @param hardFLUSH if true the containing Objects will also be deleted !! THIS IS DANGEROUS !!
  */
 void FastFactory::flushAll(bool hardFLUSH)
@@ -116,4 +123,5 @@
 /**
  * ereases all the remaining containers, without deleting the stored Objects inside of them.
+ * @param hardFLUSH if the the containing Objects will also be deleted !! THIS IS DANGEROUS !!
  */
 void FastFactory::flush(bool hardFLUSH)
@@ -140,6 +148,8 @@
 }
 
-
-
+/**
+ * generates count new Object of the Corresponding class. (precaching)
+ * @param count How many instances of the class should be generated.
+ */
 void FastFactory::prepare(unsigned int count)
 {
@@ -154,6 +164,9 @@
 }
 
-
-BaseObject* FastFactory::resurect(ClassID classID)
+/**
+ * gives back live to one Object.
+ * @return the Object to resurrect.
+ */
+BaseObject* FastFactory::resurrect()
 {
   PRINTF(4)("Resurecting Object of type %s\n", this->getName());
@@ -163,5 +176,5 @@
         "Fabricating a new %s", this->getName(), this->getName());
     this->fabricate();
-    return this->resurect(classID);
+    return this->resurrect();
   }
   else
@@ -177,7 +190,27 @@
 }
 
-
-
-void FastFactory::kill(ClassID classID, BaseObject* object)
+/**
+ * gives back live to one Object.
+ * @param classID the class From which to resurrect an Object.
+ * @return the Object to resurrect, NULL if classID is not found.
+ */
+BaseObject* FastFactory::resurrect(ClassID classID)
+{
+  FastFactory* tmpFac = FastFactory::getFirst();
+
+  while (tmpFac != NULL)
+  {
+    if (classID == tmpFac->storedClassID)
+      return tmpFac->resurrect();
+    tmpFac = tmpFac->next;
+  }
+  return NULL;
+}
+
+/**
+ * kills Object object, meaning, that it will be stored in the deadList of the FastFactory, and waiting for resurrection
+ * @param object the Object to kill.
+ */
+void FastFactory::kill(BaseObject* object)
 {
   FastObjectMember* tmpC;
@@ -194,8 +227,13 @@
   tmpC->next = this->deadList;
   tmpC->objectPointer = object;
-}
-
-
-
+  this->deadList = tmpC;
+}
+
+
+void FastFactory::kill(BaseObject* object, ClassID classID)
+{
+
+
+}
 
 
Index: orxonox/trunk/src/util/object_manager.h
===================================================================
--- orxonox/trunk/src/util/object_manager.h	(revision 4937)
+++ orxonox/trunk/src/util/object_manager.h	(revision 4938)
@@ -1,17 +1,18 @@
 /*!
-    \file object_manager.h
-  *  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
-
-    TO ADD SUPPORT FOR A CLASS do the following steps:
-    1. include the hader file : #include "class_id.h"
-    2. add the class to the type enum classID {}; in class_id.h
-    3. define a function void mCache( ClassName ) in class ObjectManager
-
+ * @file object_manager.h
+ * The ObjectManager (FastFactory) is designed, to automatically generate and remove
+ * (without to much overhead) many instances of different classes.
+ *
+ * It is especially usefull for objects, that come only for a short time into existence,
+ * and get killed after a small amount of time (like shots).
+ *
+ * The Creation of an Object is usually done in the Weapon Class, where one subscribes
+ * a Projectile with:
+ * this->bulletFactory = tFastFactory<TestBullet>::getFastFactory(CL_TEST_BULLET, "TestBullet");
+ * (this might change over time).
+ * Then you can at loading time initialize an amount of the class with something like:
+ * this->bulletFactory->prepare(100); // creates 100 entities of TestBullet (dead ones)
+ * afterwards one can just retrieve an Object form the Class with
+ * this->bulletFactory->resurrect();  // this returns a BaseObject an Object of the class.
 */
 
@@ -21,9 +22,9 @@
 
 #include "base_object.h"
-#include "class_id.h"
 
+
+// FORWARD DECLARATION //
+class GarbageCollector;
 template<class T> class tList;
-class GarbageCollector;
-
 
 /**
@@ -36,14 +37,17 @@
 struct FastObjectMember
 {
-  BaseObject*               objectPointer;
+  BaseObject*          objectPointer;      //!< Pointer to the Object Stored in this Class (if it is the DeadList, else it is bork)
 
-  FastObjectMember*         next;
+  FastObjectMember*    next;               //!< the next stored FastObjectMember. (or NULL if this is the last one stored in either the deadList or the unusedContainers)
 };
 
 //! The FastFactory is a fast loadable object creator, and Dynamic List of dead object handler.
 /**
+ * The ObjectManager (FastFactory) is designed, to automatically generate and remove
+ * (without to much overhead) many instances of different classes.
+ *
  * FastFactory is needed to glue all the tFastFactory<T>'s together.
- * Furthermore one can retrieve the corresponding tFastFactory over
- * tFastFactory<T>* = FastFacroty::getFastFactory(ID);
+ * It is also the general class that implements the necessary functions
+ * to generate, resurrect kill and stuff...
  */
 class FastFactory : public BaseObject {
@@ -53,8 +57,9 @@
 
     // functions to push and pop elements of this class
-    BaseObject* resurect(ClassID classID);
-    void kill(ClassID classID, BaseObject* object);
+    BaseObject* resurrect();
+    static BaseObject* resurrect(ClassID classID);
+    void kill(BaseObject* object);
+    static void kill(BaseObject* object, ClassID classID);
 
-    virtual void fabricate() = NULL;
     void prepare(unsigned int count);
     // retrival functions for fast Ineraction
@@ -76,5 +81,5 @@
 
 //    virtual BaseObject* fabricate(ClassID classID) = NULL;
-
+    virtual void fabricate() = NULL;
     static FastFactory* searchFastFactory(ClassID classID, const char* fastFactoryName = NULL);
 
@@ -104,11 +109,8 @@
     static tFastFactory<T>* getFastFactory(ClassID classID, const char* fastFactoryName = NULL);
 
-    T* resurect();
   private:
     tFastFactory(ClassID classID, const char* fastFactoryName);
 
     virtual void fabricate();
-
-  private:
 };
 
@@ -149,26 +151,11 @@
 }
 
-template<class T>
-    T* tFastFactory<T>::resurect()
-{
-  PRINTF(4)("Resurecting Object of type %s\n", this->getName());
-  if (unlikely(this->deadList == NULL))
-  {
-    PRINTF(2)("The deadList of Class %s is empty, this may be either because it has not been filled yet, or the cache is to small.\n" \
-        "Fabricating a new %s", this->getName(), this->getName());
-    this->fabricate();
-    return resurect();
-  }
-  else
-  {
-    FastObjectMember* tmpC = deadList;
-    this->deadList = this->deadList->next;
 
-    tmpC->next = this->unusedContainers;
-    this->unusedContainers = tmpC;
 
-    return dynamic_cast<T*>(tmpC->objectPointer);
-  }
-}
+
+
+
+
+
 
 ////////////////////
@@ -186,5 +173,5 @@
   void registerClass(ClassID classID);
 
-  BaseObject* resurect();
+  BaseObject* resurrect();
   void kill(BaseObject* object);
 
Index: orxonox/trunk/src/world_entities/weapons/test_gun.cc
===================================================================
--- orxonox/trunk/src/world_entities/weapons/test_gun.cc	(revision 4937)
+++ orxonox/trunk/src/world_entities/weapons/test_gun.cc	(revision 4938)
@@ -158,6 +158,5 @@
 void TestGun::fire()
 {
-  Projectile* pj =  this->bulletFactory->resurect();//new TestBullet();//dynamic_cast<Projectile*>(ObjectManager::getInstance()->getFromDeadList(CL_TEST_BULLET & CL_MASK_LOWLEVEL_CLASS));
-//  weaponSource->play();
+  Projectile* pj =  dynamic_cast<Projectile*>(this->bulletFactory->resurrect());
 
   pj->setAbsCoor(this->getEmissionPoint());
