Index: code/branches/pickup2/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/pickup2/src/orxonox/CMakeLists.txt	(revision 5953)
+++ code/branches/pickup2/src/orxonox/CMakeLists.txt	(revision 6405)
@@ -46,5 +46,4 @@
 ADD_SUBDIRECTORY(items)
 ADD_SUBDIRECTORY(overlays)
-ADD_SUBDIRECTORY(pickup)
 ADD_SUBDIRECTORY(sound)
 ADD_SUBDIRECTORY(weaponsystem)
@@ -55,6 +54,4 @@
   TOLUA_FILES
     LevelManager.h
-    pickup/BaseItem.h
-    pickup/PickupInventory.h
   DEFINE_SYMBOL
     "ORXONOX_SHARED_BUILD"
Index: code/branches/pickup2/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/branches/pickup2/src/orxonox/OrxonoxPrereqs.h	(revision 5953)
+++ code/branches/pickup2/src/orxonox/OrxonoxPrereqs.h	(revision 6405)
@@ -117,4 +117,6 @@
     class GametypeMessageListener;
     class NotificationListener;
+    class Pickupable;
+    class PickupCarrier;
     class PlayerTrigger;
     class RadarListener;
@@ -133,19 +135,4 @@
     class OrxonoxOverlay;
     class OverlayGroup;
-
-    // pickup
-    class BaseItem;
-    class DroppedItem;
-    class EquipmentItem;
-    class ModifierPickup;
-    class PassiveItem;
-    class PickupCollection;
-    class PickupInventory;
-    class PickupSpawner;
-    class UsableItem;
-    // pickup, items
-    class HealthImmediate;
-    class HealthUsable;
-    class Jump;
 
     //sound
Index: code/branches/pickup2/src/orxonox/interfaces/InterfaceCompilation.cc
===================================================================
--- code/branches/pickup2/src/orxonox/interfaces/InterfaceCompilation.cc	(revision 5953)
+++ code/branches/pickup2/src/orxonox/interfaces/InterfaceCompilation.cc	(revision 6405)
@@ -34,4 +34,6 @@
 
 #include "GametypeMessageListener.h"
+#include "Pickupable.h"
+#include "PickupCarrier.h"
 #include "PlayerTrigger.h"
 #include "RadarListener.h"
@@ -51,5 +53,35 @@
         RegisterRootObject(GametypeMessageListener);
     }
+    
+    //----------------------------
+    // Pickupable
+    //----------------------------
+    Pickupable::Pickupable()
+    {
+        RegisterRootObject(Pickupable);
 
+        this->used_ = false;
+        this->owner_ = NULL;
+    }
+    
+    //----------------------------
+    // PickupCarrier
+    //----------------------------
+    PickupCarrier::PickupCarrier()
+    {
+        RegisterRootObject(PickupCarrier);
+    }
+
+    //----------------------------
+    // PlayerTrigger
+    //----------------------------
+    PlayerTrigger::PlayerTrigger()
+    {
+        RegisterRootObject(PlayerTrigger);
+
+        this->player_ = NULL;
+        this->isForPlayer_ = true;
+    }
+    
     //----------------------------
     // RadarListener
@@ -83,14 +115,3 @@
         RegisterRootObject(NotificationListener);
     }
-
-    //----------------------------
-    // PlayerTrigger
-    //----------------------------
-    PlayerTrigger::PlayerTrigger()
-    {
-        RegisterRootObject(PlayerTrigger);
-
-        this->player_ = NULL;
-        this->isForPlayer_ = true;
-    }
 }
Index: code/branches/pickup2/src/orxonox/interfaces/PickupCarrier.h
===================================================================
--- code/branches/pickup2/src/orxonox/interfaces/PickupCarrier.h	(revision 6405)
+++ code/branches/pickup2/src/orxonox/interfaces/PickupCarrier.h	(revision 6405)
@@ -0,0 +1,60 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of the PickupCarrier class.
+*/
+
+#ifndef _PickupCarrier_H__
+#define _PickupCarrier_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/OrxonoxClass.h"
+
+#include <set>
+
+namespace orxonox
+{
+
+    class _OrxonoxExport PickupCarrier : public OrxonoxClass
+    {
+        
+        public:
+            PickupCarrier();
+            virtual ~PickupCarrier();
+        
+        private:
+            
+            std::set<Pickupable*> pickups_;
+        
+    };
+    
+}
+
+#endif /* _PickupCarrier_H__ */
Index: code/branches/pickup2/src/orxonox/interfaces/Pickupable.h
===================================================================
--- code/branches/pickup2/src/orxonox/interfaces/Pickupable.h	(revision 6405)
+++ code/branches/pickup2/src/orxonox/interfaces/Pickupable.h	(revision 6405)
@@ -0,0 +1,197 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of the Pickupable class.
+*/
+
+#ifndef _Pickupable_H__
+#define _Pickupable_H__
+
+#include "OrxonoxPrereqs.h"
+#include "core/OrxonoxClass.h"
+
+#include "core/Identifier.h"
+#include "core/Super.h"
+#include "interfaces/PickupCarrier.h"
+#include "worldentities/pawns/Pawn.h"
+#include <list>
+
+namespace orxonox
+{
+
+    //! Enum for the activation type.
+    namespace pickupActivationType
+    {
+        enum Value
+        {
+            immediate,
+            onUse,
+        };
+    }
+    
+    //! Enum for the duration tyoe.
+    namespace pickupDurationType
+    {
+        enum Value
+        {
+            once,
+            continuous,
+        };
+    }
+    
+    /**
+    @brief
+        An Interface (or more precisely an abstract Class) to model and manage different (all kinds of) pickups.
+    @author
+        Damian 'Mozork' Frick
+    */
+    //TODO: Add stuff like weight/space ?
+    class _OrxonoxExport Pickupable : virtual public OrxonoxClass
+    {
+        public:
+            Pickupable(); //!< Default constructor.
+            virtual ~Pickupable() {} //!< Default destructor.
+            
+            /**
+            @brief Get the activation type of the pickup.
+            @return Returns the activation type of the pickup.
+            */
+            inline pickupActivationType::Value getActivationType(void)
+                { return this->activationType_; }
+            /**
+            @brief Get the duration type of the pickup.
+            @return Returns the duration type of the pickup.
+            */
+            inline pickupDurationType::Value getDurationType(void)
+                { return this->durationType_; }
+                
+            /**
+            @brief Get the owner of the pickup.
+            @return Returns a pointer to the owner of the pickup.
+            */
+            inline PickupCarrier* getOwner(void)
+                { return this->owner_; }
+                
+            /**
+            @brief Get whether the pickup is currently in use or not.
+            @return Returns true if the pickup is currently in use.
+            */
+            inline bool isUsed(void)
+                { return this->used_; }
+                
+            /**
+            @brief Get whether the given pawn is a target of this pickup.
+            @param pawn The Pawn of which it has to be determinde whether it is a target of this pickup.
+            @return Retruns true if the given Pawn is a target.
+            */
+            //TODO: Determine whether Pawn includes all possible cases and if PickupCarrier wouldn't be better.
+            inline bool isTarget(Pawn* pawn)
+                {
+                    Identifier* identifier = pawn->getIdentifier();
+                    for(std::list<Identifier*>::iterator it = this->targets_.begin(); it != this->targets_.end(); it++)
+                    {
+                        if(identifier->isA(*it))
+                            return true;
+                    }
+                    return false;
+                }
+                
+            /**
+            @brief  Should be called when the pickup has transitetd from used to unused or the other way around.
+                    Any Class overwriting this method must call its SUPER function by adding SUPER(Classname, changedUsed); to their changeUsed method.
+            */
+            virtual inline void changedUsed(void)
+                {
+                    if(this->isUsed())
+                        this->used_ = false;
+                    else
+                        this->used_ = true;
+                }
+
+            /**
+            @brief  Sets the pickup to used and makes sure the effects of the pickup take effect at the right places.
+                    This method needs to be implemented by any Class inheriting from Pickupable.
+            @return Returns false if for some reason the method could not take effect, e.g. because it is already in use, or some other circumstance.
+            */
+            virtual bool use(void) = 0;
+            /**
+            @brief  Sets the pickup to unused and makes sure the effects of the pickup no longer take effect.
+                    This method needs to be implemented by any Class inheriting from Pickupable.
+            @return Returns false if for some reason the method could not take effect, e.g. because the pickup is already unused, or some other circumstance.
+            */
+            virtual bool unuse(void) = 0;
+            
+            /**
+            @brief  Adds the pickup to the input PickupCarrier.
+                    This method needs to be implemented by any Class inheriting from Pickupable.
+            @return Returns false if, for some reason, the pickup could not be picked up.
+            */
+            //TODO: Maybe better in PickupCarrier?
+            virtual bool pickup(PickupCarrier* carrier) = 0;
+            /**
+            @brief  Drops the pickup. Creates a PickupSpawner at the place the Pickup has been dropped.
+                    This method needs to be implemented by any Class inheriting from Pickupable.
+            @return Returns false if the pickup could not be dropped.
+            */
+            //TODO: Probably could be done here?
+            virtual bool drop(void) = 0;
+            
+            /**
+            @brief  Creates a duplicate of the pickup.
+                    This method needs to e implemented by any Class inheriting from Pickupable.
+            @return Returns the clone of this pickup as a pointer to a Pickupable.
+            */
+            //TODO: Would be nicer if standard case was implemented here.
+            virtual Pickupable* clone(void) = 0;
+            
+            /**
+            @brief Sets the owner of the pickup.
+            @param owner Sets the input PickupCarrier as the owner of the pickup.
+            */
+            //TODO: Protected? Check for NULL and return true/false?
+            inline void setOwner(PickupCarrier* owner)
+                { this->owner_ = owner; }
+            
+        private:
+            
+            pickupActivationType::Value activationType_; //!< The activation type of the Pickup.
+            pickupDurationType::Value durationType_; //!< The duration type of the pickup.
+            
+            bool used_; //!< Whether the pickup is currently in use or not.
+            
+            PickupCarrier* owner_; //!< The owner of the pickup.
+            std::list<Identifier*> targets_; //!< The possible targets of this pickup.
+
+    };
+    
+    SUPER_FUNCTION(10, Pickupable, changedUsed, true)
+}
+
+#endif /* _Pickupable_H__ */
Index: code/branches/pickup2/src/orxonox/items/Engine.cc
===================================================================
--- code/branches/pickup2/src/orxonox/items/Engine.cc	(revision 5953)
+++ code/branches/pickup2/src/orxonox/items/Engine.cc	(revision 6405)
@@ -35,5 +35,6 @@
 #include "Scene.h"
 #include "worldentities/pawns/SpaceShip.h"
-#include "pickup/ModifierType.h"
+//TODO: Remove.
+//#include "pickup/ModifierType.h"
 #include "tools/Shader.h"
 
@@ -193,5 +194,6 @@
         }
 
-        this->ship_->setAcceleration(this->ship_->getPickups().processModifiers(ModifierType::Acceleration, this->ship_->getOrientation() * acceleration, false));
+        //TODO: Remove.
+        //this->ship_->setAcceleration(this->ship_->getPickups().processModifiers(ModifierType::Acceleration, this->ship_->getOrientation() * acceleration, false));
 
         if (!this->ship_->getPermanentBoost())
Index: code/branches/pickup2/src/orxonox/pickup/CMakeLists.txt
===================================================================
--- code/branches/pickup2/src/orxonox/pickup/CMakeLists.txt	(revision 5953)
+++ code/branches/pickup2/src/orxonox/pickup/CMakeLists.txt	(revision 6405)
@@ -1,5 +1,4 @@
 ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   BaseItem.cc
-  DroppedItem.cc
   EquipmentItem.cc
   ModifierPickup.cc
@@ -7,5 +6,4 @@
   PickupCollection.cc
   PickupInventory.cc
-  PickupSpawner.cc
   UsableItem.cc
 )
Index: code/branches/pickup2/src/orxonox/pickup/DroppedItem.cc
===================================================================
--- code/branches/pickup2/src/orxonox/pickup/DroppedItem.cc	(revision 5953)
+++ 	(revision )
@@ -1,114 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Daniel 'Huty' Haggenmueller
- *   Co-authors:
- *      ...
- *
- */
-
-#include "DroppedItem.h"
-
-#include "util/Math.h"
-#include "core/CoreIncludes.h"
-#include "core/Executor.h"
-#include "BaseItem.h"
-#include "graphics/Billboard.h"
-#include "graphics/Model.h"
-#include "worldentities/pawns/Pawn.h"
-
-namespace orxonox
-{
-    CreateFactory(DroppedItem); //TODO: This isn't needed, is it?
-
-    /**
-    @brief
-        Constructor. Registers object and sets default values.
-    */
-    DroppedItem::DroppedItem(BaseObject* creator) : PickupSpawner(creator)
-    {
-        RegisterObject(DroppedItem);
-    }
-
-    DroppedItem::DroppedItem(BaseObject* creator, BaseItem* item, float triggerDistance, float respawnTime, int maxSpawnedItems) : PickupSpawner(creator, item, triggerDistance, respawnTime, maxSpawnedItems)
-    {
-        RegisterObject(DroppedItem);
-        this->item_ = item;
-    }
-
-    /**
-    @brief
-        Default destructor.
-    */
-    DroppedItem::~DroppedItem()
-    {
-        
-    }
-
-    BaseItem* DroppedItem::getItem(void)
-    {
-        return this->item_;
-    }
-
-    /**
-    @brief
-        
-    */
-    //TODO: Comment.
-    //Each pickup should have a XML template where the Model and Billboard, and so on, is specified.
-    /*static*/ DroppedItem* DroppedItem::createDefaultDrop(BaseItem* item, const Vector3& position, const ColourValue& flareColour, float timeToLive)
-    {
-        //TODO: triggerDistance?
-        float triggerDistance = 20.0;
-        DroppedItem* droppedItem = new DroppedItem(item, item, triggerDistance, 0, 1);
-        
-        //TODO: Do this somehwere else?
-        Model* model = new Model(item);
-        Billboard* billboard = new Billboard(item);
-
-        model->setMeshSource("sphere.mesh");
-        model->setScale(3.0f);
-
-        billboard->setMaterial("Examples/Flare");
-        billboard->setColour(flareColour);
-        billboard->setScale(0.5f);
-
-        droppedItem->setPosition(position);
-        droppedItem->attach(model);
-        droppedItem->attach(billboard);
-
-        COUT(3) << "Created DroppedItem for '" << item->getPickupIdentifier() << "' at (" << position.x << "," << position.y << "," << position.z << ")." << std::endl;
-
-        return droppedItem;
-    }
-
-    /**
-    @brief
-
-    */
-    //TODO: See one function above.
-    DroppedItem* DroppedItem::createDefaultDrop(BaseItem* item, Pawn* pawn, const ColourValue& flareColour, float timeToLive)
-    {
-        Vector3 after = pawn->getPosition() + pawn->getOrientation() * Vector3(0.0f, 0.0f, 50.0f);
-        return DroppedItem::createDefaultDrop(item, after, flareColour, timeToLive);
-    }
-}
Index: code/branches/pickup2/src/orxonox/pickup/DroppedItem.h
===================================================================
--- code/branches/pickup2/src/orxonox/pickup/DroppedItem.h	(revision 5953)
+++ 	(revision )
@@ -1,63 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Daniel 'Huty' Haggenmueller
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @file
-    @brief Definition of DroppedItem
-*/
-
-#ifndef _DroppedItem_H__
-#define _DroppedItem_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "PickupSpawner.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport DroppedItem : public PickupSpawner
-    {
-        public:
-            DroppedItem(BaseObject* creator);
-            DroppedItem(BaseObject* creator, BaseItem* item, float triggerDistance, float respawnTime, int maxSpawnedItems);
-            virtual ~DroppedItem();
-
-            static DroppedItem* createDefaultDrop(BaseItem* item, const Vector3& position, const ColourValue& flareColour = ColourValue(0.5f, 1.0f, 0.3f), float timeToLive = 0);
-            static DroppedItem* createDefaultDrop(BaseItem* item, Pawn* pawn, const ColourValue& flareColour = ColourValue(0.5f, 1.0f, 0.3f), float timeToLive = 0);
-
-        protected:
-            virtual BaseItem* getItem(void);
-
-        private:
-
-            BaseItem* item_; //!< The dropped item.
-
-    };
-}
-
-#endif /* _DroppedItem_H__ */
Index: code/branches/pickup2/src/orxonox/pickup/PickupCollection.cc
===================================================================
--- code/branches/pickup2/src/orxonox/pickup/PickupCollection.cc	(revision 5953)
+++ code/branches/pickup2/src/orxonox/pickup/PickupCollection.cc	(revision 6405)
@@ -52,11 +52,13 @@
 
     /**
-        @brief
-            Add an item to the collection.
-
-            Only adds the item if there's a free slot for it.
-
-        @param item Item to add to the collection.
-        @return Returns whether the item has been added to the collection.
+    @brief
+        Add an item to the collection.
+
+        Only adds the item if there's a free slot for it.
+
+    @param item
+        Item to add to the collection.
+    @return
+        Returns whether the item has been added to the collection.
     */
     bool PickupCollection::add(BaseItem* item)
Index: code/branches/pickup2/src/orxonox/pickup/PickupCollection.h
===================================================================
--- code/branches/pickup2/src/orxonox/pickup/PickupCollection.h	(revision 5953)
+++ code/branches/pickup2/src/orxonox/pickup/PickupCollection.h	(revision 6405)
@@ -50,8 +50,7 @@
     @author Daniel 'Huty' Haggenmueller
     */
-    class _OrxonoxExport PickupCollection
+    class _OrxonoxExport PickupCollection : public orxonox::OrxonoxClass
     {
         public:
-            //TODO: Should probably be derived from OrxonoxClass???
             PickupCollection();
 
@@ -65,27 +64,7 @@
             void remove(BaseItem* item, bool removeAllOfType = false);                  //!< Remove an item from the collection.
 
-            //TODO: What's up with that?
+            //TODO: Hmm... probably should stay...
             void useItem();                                                             //!< Use the first usable item.
             void useItem(UsableItem* item);                                             //!< Use a usable item.
-
-            //TODO: This really shouldn't be here. It's nbot the Collections business to know about stuff like that.
-            void addAdditiveModifier(ModifierType::Value type, float value);             //!< Add an additive modifier.
-            void addMultiplicativeModifier(ModifierType::Value type, float value);       //!< Add a multiplicative modifier.
-
-            float getAdditiveModifier(ModifierType::Value type);                         //!< Get total additive modifier.
-            float getMultiplicativeModifier(ModifierType::Value type);                   //!< Get total multiplicative modifier.
-
-            void removeAdditiveModifier(ModifierType::Value type, float value);          //!< Remove an additive modifier.
-            void removeMultiplicativeModifier(ModifierType::Value type, float value);    //!< Remove a multiplicative modifier.
-
-            float processModifiers(ModifierType::Value type, float inputValue, bool addBeforeMultiplication = false);        //!< Apply the modifiers to a float.
-            Vector3 processModifiers(ModifierType::Value type, Vector3 inputValue, bool addBeforeMultiplication = false);    //!< Apply the modifiers to a Vector3.
-
-            /**
-                @brief Get the map of contained items.
-                @return The map of items.
-            */
-            std::multimap<std::string, BaseItem*> getItems() const
-                { return this->items_; }
 
             /**
@@ -110,12 +89,9 @@
             std::deque<PassiveItem*> getPassiveItems();     //!< Get a list of passive items.
             std::deque<UsableItem*> getUsableItems();      //!< Get a list of usable items.
+
         private:
-            Pawn* owner_;           //!< The owner of the PickupCollection.
+            Pawn* owner_; //!< The owner of the PickupCollection.
             UsableItem* currentUsable_;
-
-            bool bBlockRemovals_;   //!< Whether to block direct removals through remove().
-
-            std::multimap<ModifierType::Value, float> additiveModifiers_;        //!< Contains additive modifiers (indexed by ModifierType).
-            std::multimap<ModifierType::Value, float> multiplicativeModifiers_;  //!< Contains multiplicative modifiers (indexed by ModifierType).
+            int slots_;
 
             std::multimap<std::string, BaseItem*> items_;                       //!< Map of items in the collection (indexed by pickupIdentifier of the items).
Index: code/branches/pickup2/src/orxonox/pickup/PickupSpawner.cc
===================================================================
--- code/branches/pickup2/src/orxonox/pickup/PickupSpawner.cc	(revision 5953)
+++ 	(revision )
@@ -1,270 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Daniel 'Huty' Haggenmueller
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @file
-    @brief Implementation of PickupSpawner.
-*/
-
-#include "PickupSpawner.h"
-
-#include "BaseItem.h"
-
-#include "core/CoreIncludes.h"
-#include "core/GUIManager.h"     // HACK; see below
-#include "core/Template.h"
-#include "core/XMLPort.h"
-#include "worldentities/pawns/Pawn.h"
-#include "PickupInventory.h"    // HACK; Only for hack, remove later
-
-
-namespace orxonox
-{
-
-    const float PickupSpawner::bounceSpeed_s = 6.0f;
-    const float PickupSpawner::rotationSpeed_s = 1.0f;
-    const float PickupSpawner::bounceDistance_s = 4.0f;
-
-    CreateFactory(PickupSpawner);
-
-    /**
-    @brief
-        Constructor. Registers the PickupSpawner.
-    @param creator
-        Pointer to the object which created this item.
-    */
-    PickupSpawner::PickupSpawner(BaseObject* creator) : StaticEntity(creator)
-    {
-        this->initialize();
-    }
-
-    PickupSpawner::PickupSpawner(BaseObject* creator, BaseItem* item, float triggerDistance, float respawnTime, int maxSpawnedItems) : StaticEntity(creator)
-    {
-        this->initialize();
-  
-        //TODO: Does this actually work?
-        this->itemTemplateName_ = item->getIdentifier()->getName();
-        this->itemTemplate_ = Template::getTemplate(this->itemTemplateName_);
-
-        this->triggerDistance_ = triggerDistance;
-        this->respawnTime_ = respawnTime;
-        this->setMaxSpawnedItems(maxSpawnedItems);
-    }
-
-    void PickupSpawner::initialize(void)
-    {
-        RegisterObject(PickupSpawner);
-
-        this->itemTemplate_ = NULL;
-        this->triggerDistance_ = 20;
-        this->respawnTime_ = 0.0f;
-        this->tickSum_ = 0.0f;
-        this->maxSpawnedItems_ = INF;
-        this->spawnsRemaining_ = INF;
-    }
-
-    /**
-    @brief
-        Destructor.
-    */
-    PickupSpawner::~PickupSpawner()
-    {
-        
-    }
-
-    /**
-    @brief
-        Method for creating a PickupSpawner through XML.
-    @param xmlelement
-        XML element which contains the PickupSpawner.
-    @param mode
-        XMLPort mode.
-    */
-    void PickupSpawner::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(PickupSpawner, XMLPort, xmlelement, mode);
-
-        XMLPortParam(PickupSpawner, "item", setItemTemplateName, getItemTemplateName, xmlelement, mode);
-        XMLPortParam(PickupSpawner, "triggerDistance", setTriggerDistance, getTriggerDistance, xmlelement, mode);
-        XMLPortParam(PickupSpawner, "respawnTime", setRespawnTime, getRespawnTime, xmlelement, mode);
-        XMLPortParam(PickupSpawner, "maxSpawnedItems", setMaxSpawnedItems, getMaxSpawnedItems, xmlelement, mode);
-
-        //TODO: Kill hack.
-        // HACKs
-        // Load the GUI image as soon as the PickupSpawner gets loaded
-        //  = less delays while running
-        BaseObject* newObject = this->itemTemplate_->getBaseclassIdentifier()->fabricate(this);
-        BaseItem* asItem = orxonox_cast<BaseItem*>(newObject);
-        if (asItem)
-        {
-            asItem->addTemplate(this->itemTemplate_);
-            PickupInventory::getImageForItem(asItem);
-            newObject->destroy();
-        }
-
-        //  & load the GUI itself too, along with some empty windows
-        //   = even less delays
-        GUIManager::getInstance().showGUI("PickupInventory");
-        GUIManager::getInstance().executeCode("hideGUI(\"PickupInventory\")");
-        PickupInventory::getSingleton();
-    }
-
-    /**
-    @brief
-        Invoked when the activity has changed. Sets visibility of attached objects.
-    */
-    void PickupSpawner::changedActivity()
-    {
-        SUPER(PickupSpawner, changedActivity);
-
-        for (std::set<WorldEntity*>::const_iterator it = this->getAttachedObjects().begin(); it != this->getAttachedObjects().end(); it++)
-            (*it)->setVisible(this->isActive());
-    }
-
-    /**
-    @brief
-        Set the template name of the item to spawn, also loads the template.
-    @param name
-        Name of the new template.
-    */
-    void PickupSpawner::setItemTemplateName(const std::string& name)
-    {
-        this->itemTemplateName_ = name;
-        this->itemTemplate_ = Template::getTemplate(name);
-    }
-
-    void PickupSpawner::setMaxSpawnedItems(int items)
-    {
-        this->maxSpawnedItems_ = items;
-        this->spawnsRemaining_ = items;
-    }
-
-    /**
-    @brief
-        Tick, checks if any Pawn is close enough to trigger.
-    @param dt
-        Time since last tick.
-    */
-    //TODO: Replace this with a real DistanceTrigger.
-    void PickupSpawner::tick(float dt)
-    {
-        if (this->isActive())
-        {
-            //! Triggers as soon as a Pawn is in the specified distance.
-            for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
-            {
-                Vector3 distance = it->getWorldPosition() - this->getWorldPosition();
-                if (distance.length() < this->triggerDistance_)
-                    this->trigger(*it);
-            }
-
-            //! Animation.
-            this->yaw(Radian(rotationSpeed_s*dt));
-            this->tickSum_ += bounceSpeed_s*dt;
-            this->translate(Vector3(0,bounceDistance_s*dt*sin(this->tickSum_),0));
-            if (this->tickSum_ > 2*Ogre::Math::PI)
-                this->tickSum_ -= 2*Ogre::Math::PI;
-        }
-    }
-
-    /**
-    @brief
-        Trigger the PickupSpawner.
-
-        Adds the pickup to the Pawn that triggered,
-        sets the timer to re-activate and deactives the PickupSpawner.
-
-    @param pawn
-        Pawn which triggered the PickupSpawner.
-    */
-    void PickupSpawner::trigger(Pawn* pawn)
-    {
-        if (this->isActive() && this->itemTemplate_ && this->itemTemplate_->getBaseclassIdentifier()) //!< Checks whether PickupItem is active, amongst other things.
-        {
-            BaseItem* item = this->getItem();
-            if (item != NULL) //!< If the conversion was successful.
-            {
-                item->setPickupIdentifier(this->itemTemplateName_); //TODO: Needed?
-                item->addTemplate(this->itemTemplate_); //TODO: Does what?
-
-                if(item->pickedUp(pawn))
-                {
-                    COUT(3) << this->itemTemplateName_ << " got picked up." << std::endl;
-
-
-                    if(this->spawnsRemaining_ != INF)
-                    {
-                        this->spawnsRemaining_--;
-                    }
-
-                    if (this->spawnsRemaining_ != 0 && this->respawnTime_ > 0.0f)
-                    {
-                        this->respawnTimer_.setTimer(this->respawnTime_, false, createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback, this)));
-
-                        this->setActive(false);
-                        this->fireEvent();
-                    }
-                }
-                else
-                {
-                    item->destroy();
-                }
-            }
-        }
-
-        if(this->spawnsRemaining_ == 0)
-        {
-            COUT(3) << "PickupSpawner empty, selfdistruct initialized." << std::endl;
-            this->setActive(false);
-            this->destroy();
-        }
-    }
-
-    /**
-    @brief
-        Creates a BaseItem of the type specified by the PickupSpawner.
-    @return
-        The BaseItem created.
-    */    
-    BaseItem* PickupSpawner::getItem(void)
-    {
-        BaseObject* newItem = this->itemTemplate_->getBaseclassIdentifier()->fabricate(this); //!< Creates new object of specified item type.
-        return orxonox_cast<BaseItem*>(newItem);
-    }
-
-    /**
-    @brief
-        Invoked by the timer, re-activates the PickupSpawner.
-    */
-    void PickupSpawner::respawnTimerCallback()
-    {
-        COUT(3) << "PickupSpawner reactivated." << std::endl;
-
-        this->setActive(true);
-    }
-}
Index: code/branches/pickup2/src/orxonox/pickup/PickupSpawner.h
===================================================================
--- code/branches/pickup2/src/orxonox/pickup/PickupSpawner.h	(revision 5953)
+++ 	(revision )
@@ -1,138 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Daniel 'Huty' Haggenmueller
- *   Co-authors:
- *      ...
- *
- */
-
-/**
-    @file
-    @brief Definition of PickupSpawner.
-*/
-
-#ifndef _PickupSpawner_H__
-#define _PickupSpawner_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include <string>
-#include "tools/Timer.h"
-#include "tools/interfaces/Tickable.h"
-#include "worldentities/StaticEntity.h"
-
-namespace orxonox
-{
-    /**
-        @brief PickupSpawner.
-        @author Daniel 'Huty' Haggenmueller
-    */
-    class _OrxonoxExport PickupSpawner : public StaticEntity, public Tickable
-    {
-        public:
-            //TODO: Add limit of items spawned here. Also possibility to spawn collections?
-            PickupSpawner(BaseObject* creator);
-            PickupSpawner(BaseObject* creator, BaseItem* item, float triggerDistance, float respawnTime, int maxSpawnedItems);
-            virtual ~PickupSpawner();
-
-            virtual void changedActivity();                                 //!< Invoked when activity has changed (set visibilty).
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< Method for creating a PickupSpawner through XML.
-            virtual void tick(float dt);
-
-            void trigger(Pawn* pawn);                                       //!< Method called when a Pawn is close enough.
-            void respawnTimerCallback();                                    //!< Method called when the timer runs out.
-
-            /**
-            @brief Get the template name for the item to spawn.
-            @return Returns the name of the template of the item to spawn.
-            */
-            inline const std::string& getItemTemplateName() const
-                { return this->itemTemplateName_; }
-            void setItemTemplateName(const std::string& name);              //!< Set the template name of the item to spawn.
-
-            /**
-                @brief Get the template for the item to spawn.
-                @return Returns the template of the item to spawn.
-            */
-            inline Template* getItemTemplate() const
-                { return this->itemTemplate_; }
-
-            /**
-                @brief Get the distance in which to trigger.
-                @return Returns the distance in which this gets triggered.
-            */
-            inline float getTriggerDistance() const
-                { return this->triggerDistance_; }
-            /**
-                @brief Set the distance in which to trigger.
-                @param value The new distance in which to trigger.
-            */
-            inline void setTriggerDistance(float value)
-                { this->triggerDistance_ = value; }
-
-            /**
-                @brief Get the time to respawn.
-                @returns Returns the time after which this gets re-actived.
-            */
-            inline float getRespawnTime() const
-                { return this->respawnTime_; }
-            /**
-                @brief Set the time to respawn.
-                @param time New time after which this gets re-actived.
-            */
-            inline void setRespawnTime(float time)
-                { this->respawnTime_ = time; }
-
-
-            inline int getMaxSpawnedItems(void)
-                { return this->maxSpawnedItems_; }
-            void setMaxSpawnedItems(int items);
-
-        protected:
-            virtual BaseItem* getItem(void);
-
-        private:
-            void initialize(void);
-
-            std::string itemTemplateName_;          //!< Template name of the item to spawn.
-            Template* itemTemplate_;                //!< Template of the item to spawn.
-
-            int maxSpawnedItems_;                   //!< Maximum number of items spawned by this PickupSpawner.
-            int spawnsRemaining_;                   //!< Number of items that can be spawned by this PickupSpawner until it selfdestructs.
-
-            float triggerDistance_;                 //!< Distance in which this gets triggered.
-
-            /* Pickup animation */
-            float tickSum_;                         //!< Adds up tick to use in sine movement
-            static const float bounceSpeed_s;       //!< Speed of pickup to bounce up and down
-            static const float bounceDistance_s;    //!< Distance the pickup bounces up and down
-            static const float rotationSpeed_s;     //!< Rotation speed of pickup
-
-            float respawnTime_;                     //!< Time after which this gets re-actived.
-            Timer respawnTimer_;                    //!< Timer used for re-activating.
-
-            static const int INF = -1;             //!< Constant for infinity.
-    };
-}
-
-#endif /* _PickupSpawner_H__ */
Index: code/branches/pickup2/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/pickup2/src/orxonox/worldentities/pawns/Pawn.cc	(revision 5953)
+++ code/branches/pickup2/src/orxonox/worldentities/pawns/Pawn.cc	(revision 6405)
@@ -70,5 +70,6 @@
         this->spawnparticleduration_ = 3.0f;
 
-        this->getPickups().setOwner(this);
+        //TODO: Remove.
+        //this->getPickups().setOwner(this);
 
         if (GameMode::isMaster())
@@ -295,8 +296,9 @@
     }
 
-    void Pawn::dropItems()
-    {
-        this->getPickups().clear();
-    }
+//TODO: Remove.
+//     void Pawn::dropItems()
+//     {
+//         this->getPickups().clear();
+//     }
 
 
Index: code/branches/pickup2/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/branches/pickup2/src/orxonox/worldentities/pawns/Pawn.h	(revision 5953)
+++ code/branches/pickup2/src/orxonox/worldentities/pawns/Pawn.h	(revision 6405)
@@ -35,5 +35,6 @@
 #include "interfaces/RadarViewable.h"
 #include "worldentities/ControllableEntity.h"
-#include "pickup/PickupCollection.h"
+//TODO: Remove.
+//#include "pickup/PickupCollection.h"
 
 namespace orxonox
@@ -109,9 +110,10 @@
                 { return this->numexplosionchunks_; }
 
-            virtual void dropItems();
-            inline PickupCollection& getPickups()
-                { return this->pickups_; }
-            virtual void useItem()
-                { this->pickups_.useItem(); }
+//TODO: Remove.
+//             virtual void dropItems();
+//             inline PickupCollection& getPickups()
+//                 { return this->pickups_; }
+//             virtual void useItem()
+//                 { this->pickups_.useItem(); }
 
             virtual void startLocalHumanControl();
@@ -128,5 +130,6 @@
             bool bAlive_;
 
-            PickupCollection pickups_;
+            //TODO: Remove.
+            //PickupCollection pickups_;
 
             float health_;
