Index: /orxonox/trunk/src/util/object_manager.cc
===================================================================
--- /orxonox/trunk/src/util/object_manager.cc	(revision 4929)
+++ /orxonox/trunk/src/util/object_manager.cc	(revision 4930)
@@ -19,4 +19,5 @@
 #include "list.h"
 
+#include "debug.h"
 
 using namespace std;
@@ -106,2 +107,56 @@
   PRINT(0)("=======================================================\n");
 }
+
+/**
+ *  constructor
+
+   set everything to zero and define factoryName
+ */
+FastObject::FastObject (const char* fastObjectName, ClassID classID)
+{
+  this->setClassID(CL_FACTORY, "FastObject");
+  this->setName(fastObjectName);
+
+  this->storedClassID = classID;
+  this->next = NULL;
+
+  FastObject::registerFastObject(this);
+}
+
+/** a reference to the First FastObject */
+FastObject* FastObject::first = NULL;
+
+/**
+ *  destructor
+
+   clear the Q
+ */
+FastObject::~FastObject ()
+{
+  //  printf("%s\n", this->factoryName);
+  //  FastObject* tmpDel = this->next;
+  //  this->next = NULL;
+  if (this->next)
+    delete this->next;
+}
+
+/**
+ *  add a FastObject to the FastObject Queue
+ * @param factory a FastObject to be registered
+ */
+void FastObject::registerFastObject( FastObject* factory)
+{
+  PRINTF(4)("Registered FastObject for '%s'\n", factory->getName());
+
+  if( FastObject::first == NULL)
+    FastObject::first = factory;
+  else
+  {
+    FastObject* tmpFac = FastObject::first;
+    while( tmpFac->next != NULL)
+    {
+      tmpFac = tmpFac->next;
+    }
+    tmpFac->setNext(factory);
+  }
+}
Index: /orxonox/trunk/src/util/object_manager.h
===================================================================
--- /orxonox/trunk/src/util/object_manager.h	(revision 4929)
+++ /orxonox/trunk/src/util/object_manager.h	(revision 4930)
@@ -10,5 +10,5 @@
 
     TO ADD SUPPORT FOR A CLASS do the following steps:
-    1. include the hader file : #include "class_header.h"
+    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
@@ -21,22 +21,7 @@
 
 #include "base_object.h"
-#include "projectile.h"
-#include "list.h"
 
+template<class T> class tList;
 class GarbageCollector;
-
-
-//! This defines the "template" macro function for cache(...)
-#define mCache( Class ) \
- cache(ClassID index, int number, Class * copyObject)        \
-{                                                              \
-  this->managedObjectList[index] = new tList<BaseObject>(); \
-  for(int i = 0; i < number; ++i)\
-    {\
-      this->managedObjectList[index]->add(new Class (*copyObject));\
-    }\
-}
-
-
 
 //! the object manager itself
@@ -51,7 +36,10 @@
 
   /** a class handled by the objectManage */
-  void mCache(Projectile);
   void addToDeadList(int index, BaseObject* object);
   BaseObject* getFromDeadList(int index, int number = 1);
+
+  BaseObject* resurect();
+  void kill(BaseObject* object);
+
 
   void debug() const;
@@ -68,3 +56,67 @@
 
 
+/**
+ * Creates a factory to a Loadable Class.
+ * this should be used at the beginning of all the Classes that should be loadable (in the cc-file)
+ */
+#define CREATE_FAST_FACTORY(CLASS_NAME, CLASS_ID) \
+    tObject<CLASS_NAME>* global_##CLASS_NAME##_Object = new tObject<CLASS_NAME>(#CLASS_NAME, CLASS_ID)
+
+//! The Factory is a loadable object handler
+class FastObject : public BaseObject {
+
+  public:
+    FastObject (const char* fastObjectName = NULL, ClassID classID = CL_NULL);
+    virtual ~FastObject ();
+
+    virtual BaseObject* fabricate(ClassID classID) = NULL;
+
+    static void registerFastObject(FastObject* fastObject);
+    /** sets the Next factory in the list @param nextFactory the next factory */
+    inline void setNext( FastObject* nextFastObject) { this->next = nextFastObject; };
+    /** @returns the first factory */
+    static FastObject* getFirst() { return FastObject::first; };
+    /** @returns the next factory */
+    FastObject* getNext() const { return this->next; };
+
+  private:
+    FastObject*          next;                 //!< pointer to the next factory.
+    static FastObject*   first;                //!< A pointer to the first factory.
+    ClassID              storedClassID;        //!< The classID of the specified class.
+};
+
+/**
+ *  a factory that is able to load any kind of Object
+   (this is a Functor)
+ */
+template<class T> class tFastObject : public FastObject
+{
+  public:
+    tFastObject(const char* fastObjectName, ClassID fastObject);
+
+  private:
+    virtual BaseObject* fabricate(ClassID fastObject);
+};
+
+/**
+ * construnts a factory with
+ * @param factoryName the name of the factory
+ */
+template<class T>
+tFastObject<T>::tFastObject(const char* fastObjectName, ClassID fastObject) : FastObject(fastObjectName, fastObject)
+{
+  PRINTF(5)("Class: %s loadable as a FastObject\n", this->getName());
+}
+
+template<class T>
+BaseObject* tFastObject<T>::fabricate(ClassID fastObject)
+{
+  if(this->classID == fastObject)
+    return new T ( root);
+  else if( getNext() != NULL)
+    return getNext()->fabricate( root);
+  else
+    return NULL;
+}
+
 #endif /* _OBJECT_MANAGER_H */
Index: /orxonox/trunk/src/world_entities/weapons/test_gun.cc
===================================================================
--- /orxonox/trunk/src/world_entities/weapons/test_gun.cc	(revision 4929)
+++ /orxonox/trunk/src/world_entities/weapons/test_gun.cc	(revision 4930)
@@ -105,4 +105,5 @@
   this->setStateDuration(WS_DEACTIVATING, .4);
 
+  this->setMaximumEnergy(1000, 10);
   this->increaseEnergy(100);
   //this->minCharge = 2;
Index: /orxonox/trunk/src/world_entities/weapons/weapon.cc
===================================================================
--- /orxonox/trunk/src/world_entities/weapons/weapon.cc	(revision 4929)
+++ /orxonox/trunk/src/world_entities/weapons/weapon.cc	(revision 4930)
@@ -88,7 +88,7 @@
 
   this->energyLoaded = .0;
-  this->energyLoadedMax = 10.0;
+  this->energyLoadedMax = 5.0;
   this->energy = .0;
-  this->energyMax = 100.0;
+  this->energyMax = 10.0;
 }
 
@@ -112,4 +112,7 @@
   if (action >= WA_ACTION_COUNT)
     return;
+  if (this->soundBuffers[action] != NULL)
+    ResourceManager::getInstance()->unload(this->soundBuffers[action]);
+
   else if (soundFile != NULL)
   {
@@ -330,4 +333,5 @@
   {
     this->requestAction(WA_RELOAD);
+    this->execute();
   }
 }
@@ -344,4 +348,5 @@
   {
     this->requestAction(WA_DEACTIVATE);
+    this->execute();
     return false;
   }
Index: /orxonox/trunk/src/world_entities/weapons/weapon.h
===================================================================
--- /orxonox/trunk/src/world_entities/weapons/weapon.h	(revision 4929)
+++ /orxonox/trunk/src/world_entities/weapons/weapon.h	(revision 4930)
@@ -110,5 +110,5 @@
 
     /** @param energyMax the maximum energy the Weapon can have @param energyLoadedMax the maximum energy in the weapon buffers */
-    inline void setMaximumEnergy(float energyMax, float energyLoadedMax = 0.0) { this->energyMax = energyMax; this->energyLoadedMax = energyLoadedMax; };
+    inline void setMaximumEnergy(float energyMax, float energyLoadedMax) { this->energyMax = energyMax; this->energyLoadedMax = energyLoadedMax; };
 
     void setActionSound(WeaponAction action, const char* soundFile);
@@ -185,5 +185,5 @@
 
     bool                 hideInactive;                    //!< Hides the Weapon if it is inactive
-    bool                 chargeable;                      //!< if the Weapon is charcheable
+    bool                 chargeable;                      //!< if the Weapon is charcheable (if true, the weapon will charge before it fires.)
 
     Projectile*          projectile;                      //!< the projectile used for this weapon
Index: /orxonox/trunk/src/world_entities/weapons/weapon_manager.h
===================================================================
--- /orxonox/trunk/src/world_entities/weapons/weapon_manager.h	(revision 4929)
+++ /orxonox/trunk/src/world_entities/weapons/weapon_manager.h	(revision 4930)
@@ -104,4 +104,3 @@
     int                     currConfID;              //<! the currently selected config
     weaponConfig            configs[4];              //<! a list of four configurations
-
 };
