Index: code/branches/pickup3/src/modules/pickup/CMakeLists.txt
===================================================================
--- code/branches/pickup3/src/modules/pickup/CMakeLists.txt	(revision 6421)
+++ code/branches/pickup3/src/modules/pickup/CMakeLists.txt	(revision 6466)
@@ -1,6 +1,13 @@
 SET_SOURCE_FILES(PICKUP_SRC_FILES
+  DroppedItem.cc
+  Pickup.cc
   PickupCollection.cc
+  PickupCollectionIdentifier.cc
+  PickupManager.cc
+  PickupRepresentation.cc
   PickupSpawner.cc
 )
+
+ADD_SUBDIRECTORY(items)
 
 ORXONOX_ADD_LIBRARY(pickup
@@ -16,3 +23,2 @@
   SOURCE_FILES ${PICKUP_SRC_FILES}
 )
-
Index: code/branches/pickup3/src/modules/pickup/DroppedItem.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/DroppedItem.cc	(revision 6421)
+++ code/branches/pickup3/src/modules/pickup/DroppedItem.cc	(revision 6466)
@@ -75,4 +75,5 @@
     }
     
+    //TODO; Doesn't seem to be needed anymore, just put setPosition in the constructor.
     void DroppedItem::createDrop(const Vector3& position)
     {
Index: code/branches/pickup3/src/modules/pickup/DroppedItem.h
===================================================================
--- code/branches/pickup3/src/modules/pickup/DroppedItem.h	(revision 6421)
+++ code/branches/pickup3/src/modules/pickup/DroppedItem.h	(revision 6466)
@@ -35,5 +35,5 @@
 #define _DroppedItem_H__
 
-#include "pickup/PickupPrereqs.h"
+#include "PickupPrereqs.h"
 
 #include "PickupSpawner.h"
Index: code/branches/pickup3/src/modules/pickup/PickupCollection.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupCollection.cc	(revision 6421)
+++ code/branches/pickup3/src/modules/pickup/PickupCollection.cc	(revision 6466)
@@ -72,6 +72,18 @@
         SUPER(PickupCollection, XMLPort, xmlelement, mode);
         
-        //TODO: Does this work? Problem could be, that Pickupable itself cannot be instantiated through XML...
+        //TODO: Does this work? Problem could be, that Pickupable itself cannot be instantiated through XML, doubt that, though.
         XMLPortObject(PickupCollection, PickupCollection, "pickupables", addPickupable, getPickupable, xmlelement, mode);
+        
+        this->initializeIdentifier();
+    }
+    
+    void PickupCollection::initializeIdentifier(void)
+    {
+        this->pickupCollectionIdentifier_.addClass(this->getIdentifier());
+        
+        for(std::vector<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+        {
+            this->pickupCollectionIdentifier_.addPickup((*it)->getPickupIdentifier());
+        }
     }
     
@@ -114,117 +126,35 @@
         for(std::vector<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
         {
-            (*it)->changedUsed();
+            (*it)->setUsed(this->isUsed());
         }
     }
     
-    /**
-    @brief
-        Puts the PickupCollection in use.
-    @return
-        Returns true if successful.
-    */
-    //TODO: Revert if one fails? (same for unused)
-    bool PickupCollection::use(void)
+    void PickupCollection::changedCarrier()
     {
-        if(this->isUsed())
-            return false;
+        SUPER(PickupCollection, changedCarrier);
         
-        bool success = true;
-        //! Set all Pickupables to used.
+        //! Change the carrier for all Pickupables this PickupCollection consists of.
         for(std::vector<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
         {
-            if(!(*it)->use())
-            {
-                success = false;
-            }
+            (*it)->setCarrier(this->getCarrier());
         }
-        
-        this->changedUsed();
-        
-        return success;
-    }
-    
-    /**
-    @brief
-        Puts the PickupCollection out of use.
-    @return
-        Returns true if successful.
-    */
-    bool PickupCollection::unuse(void)
-    {
-        if(!this->isUsed())
-            return false;
-        
-        bool success = true;
-        //! Set all Pickupables to unused.
-        for(std::vector<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
-        {
-            if(!(*it)->unuse())
-            {
-                success = false;
-            }
-        }
-        
-        this->changedUsed();
-        
-        return success;
-    }
-
-    /**
-    @brief
-        Is invoked when the pickup is picked up.
-    @param carrier
-        The PickupCarrier that is picking up this pickup.
-    @return
-        Returns true if successful.
-    */
-    //TODO: Something should happen in the carrier as well, maybe just in the carrier. Owner might not be correct if the carrier hands the pickup down or up. Maybe even a Pawn as input instead fo a carrier. Or do this in Spawner?
-    bool PickupCollection::pickup(PickupCarrier* carrier)
-    {
-        if(this->getOwner() != NULL)
-        {
-            COUT(2) << "Pickup wanted to get picked up by a new carrier, but it already has a carrier." << std::endl;
-            return false;
-        }
-        for(std::vector<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
-        {
-            (*it)->setOwner(carrier);
-        }
-        
-        this->setOwner(carrier);
-        
-        return true;
-    }
-    
-    /**
-    @brief
-        Drop the pickup.
-    @return
-        Return true if successful.
-    */
-    bool PickupCollection::drop(void)
-    {
-        this->unuse();
-        this->setOwner(NULL);
-        
-        //TODO: Create new Pickupspawner/DroppedPickup
-        return true;
     }
     
     //TODO: Steal description from Pickupable.
-    Pickupable* PickupCollection::clone()
+    void PickupCollection::clone(OrxonoxClass* item)
     {
-        Template* collectionTemplate = Template::getTemplate(this->getIdentifier()->getName());
-        BaseObject* newObject = collectionTemplate->getBaseclassIdentifier()->fabricate(this);
+        if(item == NULL)
+            item = new PickupCollection(this);
         
-        PickupCollection* newCollection = dynamic_cast<PickupCollection*>(newObject);
+        SUPER(PickupCollection, clone, item);
+        
+        PickupCollection* pickup = dynamic_cast<PickupCollection*>(item);
         for(std::vector<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
         {
             Pickupable* newPickup = (*it)->clone();
-            newCollection->pickups_.push_back(newPickup);
+            pickup->addPickupable(newPickup);
         }
-        
-        Pickupable* pickup = dynamic_cast<Pickupable*>(newCollection);
-        return pickup;
+
+        pickup->initializeIdentifier();
     }
     
Index: code/branches/pickup3/src/modules/pickup/PickupCollection.h
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupCollection.h	(revision 6421)
+++ code/branches/pickup3/src/modules/pickup/PickupCollection.h	(revision 6466)
@@ -30,9 +30,11 @@
 #define _PickupCollection_H__
 
-#include "pickup/PickupPrereqs.h"
+#include "PickupPrereqs.h"
 
 #include "interfaces/Pickupable.h"
 #include "core/BaseObject.h"
 #include "core/XMLPort.h"
+
+#include "PickupCollectionIdentifier.h"
 
 #include <list>
@@ -60,14 +62,18 @@
             virtual void changedUsed(void);
             
-            virtual bool use(void);
-            virtual bool unuse(void);
+            virtual void changedCarrier(void);
             
-            virtual bool pickup(PickupCarrier* carrier);
-            virtual bool drop(void);
+            virtual void clone(OrxonoxClass* item);
             
-            virtual Pickupable* clone(void);
+            virtual const PickupIdentifier* getPickupIdentifier(void)
+                { return &this->pickupCollectionIdentifier_; }
             
             bool addPickupable(Pickupable* pickup);
             const Pickupable* getPickupable(unsigned int index);
+            
+        protected:
+            void initializeIdentifier(void);
+            
+            PickupCollectionIdentifier pickupCollectionIdentifier_;
             
         private:
Index: code/branches/pickup3/src/modules/pickup/PickupPrereqs.h
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupPrereqs.h	(revision 6421)
+++ code/branches/pickup3/src/modules/pickup/PickupPrereqs.h	(revision 6466)
@@ -67,6 +67,13 @@
 
     class DroppedItem;
+    class Pickup;
     class PickupCollection;
+    class PickupCollectionIdentifier;
+    class PickupManager;
+    class PickupRepresentation;
     class PickupSpawner;
+    
+    //items
+    class HealthPickup;
     
 }
Index: code/branches/pickup3/src/modules/pickup/PickupSpawner.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupSpawner.cc	(revision 6421)
+++ code/branches/pickup3/src/modules/pickup/PickupSpawner.cc	(revision 6466)
@@ -39,4 +39,6 @@
 #include "core/XMLPort.h"
 #include "worldentities/pawns/Pawn.h"
+#include "PickupManager.h"
+#include "PickupRepresentation.h"
 //#include "PickupInventory.h"    // HACK; Only for hack, remove later
 
@@ -59,5 +61,14 @@
     PickupSpawner::PickupSpawner(BaseObject* creator) : StaticEntity(creator)
     {
+        RegisterObject(PickupSpawner);
+        
         this->initialize();
+        
+        PickupRepresentation* representation = PickupManager::getInstance().getRepresentation(NULL);
+        
+        COUT(1) << "MUP4 " << representation << std::endl;
+        this->attach(representation->getSpawnerRepresentation(this));
+        
+        COUT(1) << "MUP6" << std::endl;
     }
 
@@ -78,4 +89,6 @@
     PickupSpawner::PickupSpawner(BaseObject* creator, Pickupable* pickup, float triggerDistance, float respawnTime, int maxSpawnedItems) : StaticEntity(creator)
     {
+        RegisterObject(PickupSpawner);
+        
         this->initialize();
   
@@ -85,4 +98,7 @@
         this->respawnTime_ = respawnTime;
         this->setMaxSpawnedItems(maxSpawnedItems);
+        
+        PickupRepresentation* representation = PickupManager::getInstance().getRepresentation(this->pickup_->getPickupIdentifier());
+        this->attach(representation->getSpawnerRepresentation(this));
     }
 
@@ -93,6 +109,4 @@
     void PickupSpawner::initialize(void)
     {
-        RegisterObject(PickupSpawner);
-
         this->pickup_ = NULL;
         
@@ -215,5 +229,5 @@
         Time since last tick.
     */
-    //TODO: Replace this with a real DistanceTrigger?
+    //TODO: Replace this with a real DistanceTrigger? Or better with collisions?
     void PickupSpawner::tick(float dt)
     {
@@ -259,4 +273,5 @@
             if (pickup != NULL) //!< If everything went ok, and pickup is not NULL.
             {
+                //TODO: Not correct anymore.
                 PickupCarrier* carrier = dynamic_cast<PickupCarrier*>(pawn);
                 if(carrier == NULL)
@@ -266,5 +281,5 @@
                 }
                 
-                if(pickup->pickup(carrier))
+                if(carrier->pickup(pickup))
                 {
                     COUT(3) << "Pickup got picked up." << std::endl;
Index: code/branches/pickup3/src/modules/pickup/PickupSpawner.h
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupSpawner.h	(revision 6421)
+++ code/branches/pickup3/src/modules/pickup/PickupSpawner.h	(revision 6466)
@@ -35,5 +35,5 @@
 #define _PickupSpawner_H__
 
-#include "pickup/PickupPrereqs.h"
+#include "PickupPrereqs.h"
 
 #include <string>
