[Orxonox-commit 1756] r6474 - in code/branches/pickup3/src: modules/pickup modules/pickup/items orxonox/interfaces orxonox/pickup

dafrick at orxonox.net dafrick at orxonox.net
Fri Mar 5 09:49:57 CET 2010


Author: dafrick
Date: 2010-03-05 09:49:56 +0100 (Fri, 05 Mar 2010)
New Revision: 6474

Added:
   code/branches/pickup3/src/modules/pickup/Pickup.cc
   code/branches/pickup3/src/modules/pickup/Pickup.h
   code/branches/pickup3/src/modules/pickup/PickupCollectionIdentifier.cc
   code/branches/pickup3/src/modules/pickup/PickupCollectionIdentifier.h
   code/branches/pickup3/src/modules/pickup/PickupManager.cc
   code/branches/pickup3/src/modules/pickup/PickupManager.h
   code/branches/pickup3/src/modules/pickup/PickupRepresentation.cc
   code/branches/pickup3/src/modules/pickup/PickupRepresentation.h
   code/branches/pickup3/src/modules/pickup/items/
   code/branches/pickup3/src/modules/pickup/items/CMakeLists.txt
   code/branches/pickup3/src/modules/pickup/items/HealthPickup.cc
   code/branches/pickup3/src/modules/pickup/items/HealthPickup.h
   code/branches/pickup3/src/orxonox/interfaces/Pickupable.cc
   code/branches/pickup3/src/orxonox/pickup/PickupIdentifier.cc
   code/branches/pickup3/src/orxonox/pickup/PickupIdentifier.h
Removed:
   code/branches/pickup3/src/orxonox/pickup/BaseItem.cc
   code/branches/pickup3/src/orxonox/pickup/BaseItem.h
   code/branches/pickup3/src/orxonox/pickup/DroppedItem.cc
   code/branches/pickup3/src/orxonox/pickup/EquipmentItem.cc
   code/branches/pickup3/src/orxonox/pickup/EquipmentItem.h
   code/branches/pickup3/src/orxonox/pickup/ModifierPickup.cc
   code/branches/pickup3/src/orxonox/pickup/ModifierPickup.h
   code/branches/pickup3/src/orxonox/pickup/ModifierType.h
   code/branches/pickup3/src/orxonox/pickup/PassiveItem.cc
   code/branches/pickup3/src/orxonox/pickup/PassiveItem.h
   code/branches/pickup3/src/orxonox/pickup/PickupCollection.cc
   code/branches/pickup3/src/orxonox/pickup/PickupCollection.h
   code/branches/pickup3/src/orxonox/pickup/PickupInventory.cc
   code/branches/pickup3/src/orxonox/pickup/PickupInventory.h
   code/branches/pickup3/src/orxonox/pickup/PickupSpawner.cc
   code/branches/pickup3/src/orxonox/pickup/UsableItem.cc
   code/branches/pickup3/src/orxonox/pickup/UsableItem.h
   code/branches/pickup3/src/orxonox/pickup/items/
Modified:
   code/branches/pickup3/src/modules/pickup/PickupSpawner.cc
   code/branches/pickup3/src/orxonox/interfaces/InterfaceCompilation.cc
   code/branches/pickup3/src/orxonox/interfaces/PickupCarrier.h
   code/branches/pickup3/src/orxonox/interfaces/Pickupable.h
Log:
Some documenting done. Added files, that I had forgotten to add. Cleaned the old pickups out.


Added: code/branches/pickup3/src/modules/pickup/Pickup.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/Pickup.cc	                        (rev 0)
+++ code/branches/pickup3/src/modules/pickup/Pickup.cc	2010-03-05 08:49:56 UTC (rev 6474)
@@ -0,0 +1,192 @@
+/*
+ *   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:
+ *      ...
+ *
+*/
+
+#include "Pickup.h"
+
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    
+    /*static*/ const std::string Pickup::activationTypeImmediate_s = "immediate";
+    /*static*/ const std::string Pickup::activationTypeOnUse_s = "onUse";
+    /*static*/ const std::string Pickup::durationTypeOnce_s = "once";
+    /*static*/ const std::string Pickup::durationTypeContinuous_s = "continuous";
+    /*static*/ const std::string Pickup::blankString_s = "";
+    
+    //TODO: Should this bee here? Does it work without?
+    CreateFactory(Pickup);
+    
+    Pickup::Pickup(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(Pickup);
+        
+    }
+    
+    Pickup::~Pickup()
+    {
+        
+    }
+    
+    void Pickup::initializeIdentifier(void)
+    {
+        this->pickupIdentifier_.addClass(this->getIdentifier());
+        
+        //TODO: Works?
+        std::string val1 = this->getActivationType();
+        std::string type1 = "activationType";
+        this->pickupIdentifier_.addParameter(type1, val1);
+        
+        std::string val2 = this->getDurationType();
+        std::string type2 = "durationType";
+        this->pickupIdentifier_.addParameter(type2, val2);
+    }
+    
+    void Pickup::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Pickup, XMLPort, xmlelement, mode);
+
+        XMLPortParam(Pickup, "activationType", setActivationType, getActivationType, xmlelement, mode);
+        XMLPortParam(Pickup, "durationType", setDurationType, getDurationType, xmlelement, mode);
+        
+        this->initializeIdentifier();
+    }
+    
+    /**
+    @brief
+        Get the activation type of the pickup.
+    @param buffer
+        The buffer to store the activation type as string in.
+    */
+    const std::string& Pickup::getActivationType(void)
+    {
+        switch(this->activationType_)
+        {
+            case pickupActivationType::immediate:
+                return activationTypeImmediate_s;
+            case pickupActivationType::onUse:
+                return activationTypeOnUse_s;
+            default:
+                return blankString_s;
+        }
+    }
+        
+    /**
+    @brief
+        Get the duration type of the pickup.
+    @param buffer
+        The buffer to store the duration type as string in.
+    */
+    const std::string& Pickup::getDurationType(void)
+    {
+        switch(this->durationType_)
+        {
+            case pickupDurationType::once:
+                return durationTypeOnce_s;
+            case pickupDurationType::continuous:
+                return durationTypeContinuous_s;
+            default:
+                return blankString_s;
+        }
+    }
+    
+    /**
+    @brief
+        Set the activation type of the Pickup.
+    @param type
+        The activation type of the Pickup as a string.
+    */
+    void Pickup::setActivationType(const std::string& type)
+    {
+        if(type == activationTypeImmediate_s)
+        {
+            this->activationType_ = pickupActivationType::immediate;
+        }
+        else if(type == activationTypeOnUse_s)
+        {
+            this->activationType_ = pickupActivationType::onUse;
+        }
+        else
+        {
+            COUT(1) << "Invalid activationType in pickup." << std::endl;
+        }
+    }
+        
+    /**
+    @brief
+        Set the duration type of the Pickup.
+    @param type
+        The duration type of the Pickup as a string.
+    */
+    void Pickup::setDurationType(const std::string& type)
+    {
+        if(type == durationTypeOnce_s)
+        {
+            this->durationType_ = pickupDurationType::once;
+        }
+        else if(type == durationTypeContinuous_s)
+        {
+            this->durationType_ = pickupDurationType::continuous;
+        }
+        else
+        {
+            COUT(1) << "Invalid durationType in pickup." << std::endl;
+        }
+    }
+    
+    /**
+    @brief
+        Creates a duplicate of the pickup.
+    @return
+        Returns the clone of this pickup as a pointer to a Pickupable.
+    */
+    void Pickup::clone(OrxonoxClass* item)
+    {
+        if(item == NULL)
+            item = new Pickup(this);
+        
+        SUPER(Pickup, clone, item);
+        
+        Pickup* pickup = dynamic_cast<Pickup*>(item);
+        pickup->setActivationTypeDirect(this->getActivationTypeDirect());
+        pickup->setDurationTypeDirect(this->getDurationTypeDirect());
+        
+        pickup->initializeIdentifier();
+    }
+    
+    void Pickup::changedCarrier(void)
+    {
+        SUPER(Pickup, changedCarrier);
+        
+        if(this->isPickedUp() && this->isImmediate())
+        {
+            this->setUsed(true);
+        }
+    }
+    
+}

Added: code/branches/pickup3/src/modules/pickup/Pickup.h
===================================================================
--- code/branches/pickup3/src/modules/pickup/Pickup.h	                        (rev 0)
+++ code/branches/pickup3/src/modules/pickup/Pickup.h	2010-03-05 08:49:56 UTC (rev 6474)
@@ -0,0 +1,132 @@
+/*
+ *   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:
+ *      ...
+ *
+*/
+
+#ifndef _Pickup_H__
+#define Pickup_H__
+
+#include "pickup/PickupPrereqs.h"
+
+#include "interfaces/Pickupable.h"
+#include "core/BaseObject.h"
+#include "core/XMLPort.h"
+
+namespace orxonox
+{
+
+    //! Enum for the activation type.
+    namespace pickupActivationType
+    {
+        enum Value
+        {
+            immediate,
+            onUse,
+        };
+    }
+    
+    //! Enum for the duration tyoe.
+    namespace pickupDurationType
+    {
+        enum Value
+        {
+            once,
+            continuous,
+        };
+    }
+    
+    class _PickupExport Pickup : public Pickupable, public BaseObject
+    {
+        
+        public:
+            
+            Pickup(BaseObject* creator);
+            virtual ~Pickup();
+            
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            
+            /**
+            @brief Get the activation type of the pickup.
+            @return Returns the activation type of the pickup.
+            */
+            inline pickupActivationType::Value getActivationTypeDirect(void)
+                { return this->activationType_; }
+            /**
+            @brief Get the duration type of the pickup.
+            @return Returns the duration type of the pickup.
+            */
+            inline pickupDurationType::Value getDurationTypeDirect(void)
+                { return this->durationType_; }
+            
+            const std::string& getActivationType(void); //!< Get the activation type of the pickup.
+            const std::string& getDurationType(void); //!< Get the duration type of the pickup.
+            
+            inline bool isImmediate(void)
+                { return this->getActivationTypeDirect() == pickupActivationType::immediate; }
+            inline bool isOnUse(void)
+                { return this->getActivationTypeDirect() == pickupActivationType::onUse; }
+            inline bool isOnce(void)
+                { return this->getDurationTypeDirect() == pickupDurationType::once; }
+            inline bool isContinuous(void)
+                { return this->getDurationTypeDirect() == pickupDurationType::continuous; }
+                        
+            virtual void clone(OrxonoxClass* item);
+            
+            virtual void changedCarrier(void);
+                
+        protected:
+            void initializeIdentifier(void);
+            
+            /**
+            @brief Set the activation type of the pickup.
+            @param type The activation type of the pickup.
+            */
+            inline void setActivationTypeDirect(pickupActivationType::Value type)
+                { this->activationType_ = type; }
+            /**
+            @brief Set the duration type of the pickup.
+            @param type The duration type of the pickup.
+            */
+            inline void setDurationTypeDirect(pickupDurationType::Value type)
+                { this->durationType_ = type; }
+                
+            void setActivationType(const std::string& type); //!< Set the activation type of the pickup.
+            void setDurationType(const std::string& type); //!< Set the duration type of the pickup
+                
+        private:
+            pickupActivationType::Value activationType_; //!< The activation type of the Pickup.
+            pickupDurationType::Value durationType_; //!< The duration type of the pickup.
+            
+            static const std::string activationTypeImmediate_s;
+            static const std::string activationTypeOnUse_s;
+            static const std::string durationTypeOnce_s;
+            static const std::string durationTypeContinuous_s;
+            static const std::string blankString_s; //TODO: Maybe already implemented somewhere?
+        
+    };
+    
+}
+#endif // _Pickup_H__

Added: code/branches/pickup3/src/modules/pickup/PickupCollectionIdentifier.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupCollectionIdentifier.cc	                        (rev 0)
+++ code/branches/pickup3/src/modules/pickup/PickupCollectionIdentifier.cc	2010-03-05 08:49:56 UTC (rev 6474)
@@ -0,0 +1,77 @@
+/*
+ *   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:
+ *      ...
+ *   Co-authors:
+ *      ...
+ *
+*/
+
+#include "PickupCollectionIdentifier.h"
+
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    
+    PickupCollectionIdentifier::PickupCollectionIdentifier(void)
+    {
+        RegisterObject(PickupCollectionIdentifier);
+    }
+    
+    PickupCollectionIdentifier::~PickupCollectionIdentifier()
+    {
+        
+    }
+
+    int PickupCollectionIdentifier::compare(const PickupIdentifier& identifier) const
+    {
+        PickupIdentifier* temp = const_cast<PickupIdentifier*>(&identifier);
+        const PickupCollectionIdentifier* collectionIdentifier = dynamic_cast<PickupCollectionIdentifier*>(temp);
+        if(collectionIdentifier == NULL)
+        {
+            return this->compare(identifier);
+        }
+        
+        if(this->identifiers_.size() != collectionIdentifier->identifiers_.size())
+            return this->identifiers_.size()-collectionIdentifier->identifiers_.size();
+        
+        std::set<const PickupIdentifier*, PickupIdentifierCompare>::const_iterator it2 = collectionIdentifier->identifiers_.begin();
+        for(std::set<const PickupIdentifier*, PickupIdentifierCompare>::const_iterator it = this->identifiers_.begin(); it != this->identifiers_.end(); it++)
+        {
+            
+            if((*it)->compare(**it2) < 0)
+                return -1;
+            if((*it2)->compare(**it) < 0)
+                return 1;
+        }
+        
+        return 0;
+    }
+    
+    void PickupCollectionIdentifier::addPickup(const PickupIdentifier* identifier)
+    {
+        this->identifiers_.insert(identifier);
+    }
+    
+}
+

Added: code/branches/pickup3/src/modules/pickup/PickupCollectionIdentifier.h
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupCollectionIdentifier.h	                        (rev 0)
+++ code/branches/pickup3/src/modules/pickup/PickupCollectionIdentifier.h	2010-03-05 08:49:56 UTC (rev 6474)
@@ -0,0 +1,58 @@
+/*
+ *   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:
+ *      ...
+ *   Co-authors:
+ *      ...
+ *
+*/
+
+#ifndef _PickupCollectionIdentifier_H__
+#define _PickupCollectionIdentifier_H_
+
+#include "PickupPrereqs.h"
+
+#include "pickup/PickupIdentifier.h"
+#include <set>
+
+namespace orxonox
+{
+
+    class PickupCollectionIdentifier : public PickupIdentifier
+    {
+        
+        public:
+            PickupCollectionIdentifier(void);
+            ~PickupCollectionIdentifier();
+            
+            virtual int compare(const PickupIdentifier& identifier) const;
+            
+            void addPickup(const PickupIdentifier* identifier);
+            
+        private:
+            std::set<const PickupIdentifier*, PickupIdentifierPtrCompare> identifiers_;
+            
+    };
+    
+}
+
+#endif // _PickupCollectionIdentifier_H_

Added: code/branches/pickup3/src/modules/pickup/PickupManager.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupManager.cc	                        (rev 0)
+++ code/branches/pickup3/src/modules/pickup/PickupManager.cc	2010-03-05 08:49:56 UTC (rev 6474)
@@ -0,0 +1,116 @@
+/*
+ *   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:
+ *      ...
+ *   Co-authors:
+ *      ...
+ *
+*/
+
+/**
+    @file
+    @brief Implementation of the PickupManager class.
+*/
+
+#include "PickupManager.h"
+
+#include "core/CoreIncludes.h"
+#include "core/ScopedSingletonManager.h"
+#include "core/Identifier.h"
+#include "interfaces/PickupCarrier.h"
+#include "worldentities/pawns/Pawn.h"
+#include "PickupRepresentation.h"
+
+namespace orxonox
+{
+
+    ManageScopedSingleton(PickupManager, ScopeID::Root, false);
+    
+    /**
+    @brief
+        Constructor. Registers the PickupManager and creates the default PickupRepresentation.
+    */
+    PickupManager::PickupManager()
+    {
+        RegisterRootObject(PickupManager);
+        
+        this->defaultRepresentation_ = new PickupRepresentation();
+    }
+    
+    /**
+    @brief
+        Destructor.
+        Destroys the default PickupRepresentation.
+    */
+    PickupManager::~PickupManager()
+    {
+        if(this->defaultRepresentation_ != NULL)
+            this->defaultRepresentation_->destroy();
+        
+        if(this->pickupCarrierStructure_ != NULL)
+            delete this->pickupCarrierStructure_;
+    }
+    
+    /**
+    @brief
+        Registers a PickupRepresentation together with the PickupIdentifier of the Pickupable the PickupRepresentation represents.
+        For every type of Pickupable (uniquely idnetified by a PickupIdentifier) there can be one (and just one) PickupRepresentation registered.
+    @param identifier
+        The PickupIdentifier identifying the Pickupable.
+    @param representation
+        A pointer to the PickupRepresentation.
+    @return
+        Returns true if successful and false if not.
+    */
+    //TODO: Make sure that either the PickupRepresentation is destroyed upon destruction of the PickupManager if the representation wasn't created with XMLPort.
+    bool PickupManager::registerRepresentation(const PickupIdentifier& identifier, PickupRepresentation* representation)
+    {
+        if(this->representations_.find(identifier) == this->representations_.end()) //!< If the Pickupable already has a RepresentationRegistered.
+            return false;
+        
+        this->representations_[identifier] = representation;
+        
+        COUT(4) << "PickupRepresentation " << representation << " registered with the PickupManager." << std::endl;
+        return true;
+    }
+    
+    /**
+    @brief
+        Get the PickupRepresentation representing the Pickupable with the input PickupIdentifier.
+    @param identifier
+        The PickupIdentifier.
+    @return
+        Returns a pointer to the PickupRepresentation.
+    */
+    PickupRepresentation* PickupManager::getRepresentation(const PickupIdentifier* identifier)
+    {
+        std::map<const PickupIdentifier, PickupRepresentation*, PickupIdentifierCompare>::iterator it = this->representations_.find(*identifier);
+        if(it == this->representations_.end())
+        {
+            COUT(4) << "PickupManager::getRepresentation() returned default representation." << std::endl;
+            return this->defaultRepresentation_;
+        }
+        
+        return it->second;
+    }
+    
+}

Added: code/branches/pickup3/src/modules/pickup/PickupManager.h
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupManager.h	                        (rev 0)
+++ code/branches/pickup3/src/modules/pickup/PickupManager.h	2010-03-05 08:49:56 UTC (rev 6474)
@@ -0,0 +1,92 @@
+/*
+ *   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 PickupManager class.
+*/
+
+#ifndef _PickupManager_H__
+#define _PickupManager_H__
+
+#include "PickupPrereqs.h"
+
+#include <map>
+#include "util/Singleton.h"
+#include "pickup/PickupIdentifier.h"
+#include "PickupRepresentation.h"
+
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+    //TODO: Actually utilize this.
+    struct PickupCarrierNode
+    {
+        Identifier* identifier;
+        std::set<PickupCarrierNode*> children;
+    };
+
+    /**
+    @brief
+        Manages Pickupables.
+        In essence has two tasks to fulfill. Firstly it must link Pickupables (through their PickupIdentifiers) and their PickupRepresentations. Secondly it manages the Pickup GUI.
+        //TODO: Manage Pickup GUI.
+    @author
+        Damian 'Mozork' Frick
+    */
+    class _PickupExport PickupManager : public Singleton<PickupManager>, public OrxonoxClass
+    {
+        friend class Singleton<PickupManager>;
+        
+        public:
+            PickupManager();
+            virtual ~PickupManager();
+            
+            static PickupManager& getInstance() { return Singleton<PickupManager>::getInstance(); }
+            
+            bool registerRepresentation(const PickupIdentifier& identifier, PickupRepresentation* representation); //!< Registers a PickupRepresentation together with the PickupIdentifier of the Pickupable the PickupRepresentation represents.
+            PickupRepresentation* getRepresentation(const PickupIdentifier* identifier); //!< Get the PickupRepresentation representing the Pickupable with the input PickupIdentifier.
+            
+            //TODO: Delete or utilitze this.
+            //bool registerCarrier(Identifier* parent, )
+            
+        private:
+            static PickupManager* singletonPtr_s;
+            
+            PickupRepresentation* defaultRepresentation_; //!< The default PickupRepresentation.
+            std::map<const PickupIdentifier, PickupRepresentation*, PickupIdentifierCompare> representations_; //!< Map linking PickupIdentifiers (representing types if Pickupables) and PickupRepresentations.
+            
+            //TODO: Delete or utilize this.
+            PickupCarrierNode* pickupCarrierStructure_;
+        
+    };
+    
+}
+
+#endif // _PickupManager_H__

Added: code/branches/pickup3/src/modules/pickup/PickupRepresentation.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupRepresentation.cc	                        (rev 0)
+++ code/branches/pickup3/src/modules/pickup/PickupRepresentation.cc	2010-03-05 08:49:56 UTC (rev 6474)
@@ -0,0 +1,111 @@
+/*
+ *   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:
+ *      ...
+ *
+*/
+
+#include "PickupRepresentation.h"
+
+#include "core/CoreIncludes.h"
+#include "PickupManager.h"
+#include "graphics/Billboard.h"
+
+namespace orxonox
+{
+    
+    CreateFactory(PickupRepresentation);
+    
+    PickupRepresentation::PickupRepresentation() : BaseObject(this)
+    {
+        RegisterObject(PickupRepresentation);
+        
+        this->initialize();
+    }
+    
+    PickupRepresentation::PickupRepresentation(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(PickupRepresentation);
+        
+        this->initialize();
+    }
+    
+    PickupRepresentation::~PickupRepresentation()
+    {
+        
+    }
+    
+    void PickupRepresentation::initialize(void)
+    {
+        this->description_ = "This is a pickup.";
+        this->name_ = "Pickup";
+        this->spawnerTemplate_ = "";
+        this->spawnerRepresentation_ = NULL;
+        this->pickup_ = NULL;
+    }
+    
+    void PickupRepresentation::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(PickupRepresentation, XMLPort, xmlelement, mode);
+        
+        XMLPortParam(PickupRepresentation, "name", setName, getName, xmlelement, mode);
+        XMLPortParam(PickupRepresentation, "description", setDescription, getDescription, xmlelement, mode);
+        XMLPortParam(PickupRepresentation, "spawnerTemplate", setSpawnerTemplate, getSpawnerTemplate, xmlelement, mode);
+        XMLPortObject(PickupRepresentation, Pickupable, "pickup", setPickup, getPickup, xmlelement, mode);
+        XMLPortObject(PickupRepresentation, StaticEntity, "spawner-representation", setSpawnerRepresentation, getSpawnerRepresentationIndex, xmlelement, mode);
+        
+        PickupManager::getInstance().registerRepresentation(*this->pickup_->getPickupIdentifier(), this);
+    }
+    
+    StaticEntity* PickupRepresentation::getSpawnerRepresentation(PickupSpawner* spawner)
+    {
+        if(this->spawnerRepresentation_ == NULL)
+        {
+            COUT(4) << "PickupRepresentation: No spawner representation found." << std::endl;
+            if(this->spawnerTemplate_ == "")
+            {
+                COUT(4) << "PickupRepresentation: Spawner template is empty." << std::endl;
+                return this->getDefaultSpawnerRepresentation(spawner);
+            }
+            this->addTemplate(this->spawnerTemplate_);
+        }
+        StaticEntity* representation = this->spawnerRepresentation_;
+        
+        this->addTemplate(this->spawnerTemplate_);
+        
+        return representation;
+    }
+    
+    StaticEntity* PickupRepresentation::getDefaultSpawnerRepresentation(PickupSpawner* spawner)
+    {
+        StaticEntity* representation = new StaticEntity(spawner);
+        //TODO: Nicer...
+        Billboard* billboard = new Billboard(spawner);
+        billboard->setColour(ColourValue(1.0, 0.0, 0.0));
+        billboard->setMaterial("Examples/Flare");
+        representation->attach(billboard);
+        return representation;
+    }
+    
+}

Added: code/branches/pickup3/src/modules/pickup/PickupRepresentation.h
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupRepresentation.h	                        (rev 0)
+++ code/branches/pickup3/src/modules/pickup/PickupRepresentation.h	2010-03-05 08:49:56 UTC (rev 6474)
@@ -0,0 +1,95 @@
+/*
+ *   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:
+ *      ...
+ *
+*/
+
+#ifndef _PickupRepresentation_H__
+#define _PickupRepresentation_H__
+
+#include "PickupPrereqs.h"
+
+#include "core/BaseObject.h"
+
+#include "core/XMLPort.h"
+#include "pickup/PickupIdentifier.h"
+#include "interfaces/Pickupable.h"
+#include "pickup/PickupSpawner.h"
+#include "worldentities/StaticEntity.h"
+
+namespace orxonox
+{
+
+    class _PickupExport PickupRepresentation : public BaseObject
+    {
+        
+        public:
+            PickupRepresentation();
+            PickupRepresentation(BaseObject* creator);
+            virtual ~PickupRepresentation();
+            
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            
+            inline void setName(const std::string& name)
+                { this->name_ = name; }
+            inline void setDescription(const std::string& description)
+                { this->description_ = description; }
+            inline void setSpawnerTemplate(const std::string& spawnerTemplate)
+                { this->spawnerTemplate_ = spawnerTemplate; }
+            inline void setSpawnerRepresentation(StaticEntity* representation)
+                { this->spawnerRepresentation_ = representation; }
+            inline void setPickup(Pickupable* pickup)
+                { this->pickup_ = pickup; }
+                
+            inline const std::string& getName(void)
+                { return this->name_; }
+            inline const std::string& getDescription(void)
+                { return this->description_; }
+            inline const std::string& getSpawnerTemplate(void)
+                { return this->spawnerTemplate_; }
+            inline const StaticEntity* getSpawnerRepresentationIndex(unsigned int index)
+                { if(index == 0) return this->spawnerRepresentation_; return NULL; }
+            inline const Pickupable* getPickup(unsigned int index)
+                { if(index == 0) return this->pickup_; return NULL; }
+                
+            StaticEntity* getSpawnerRepresentation(PickupSpawner* spawner);
+        
+        private:
+            void initialize(void);
+            StaticEntity* getDefaultSpawnerRepresentation(PickupSpawner* spawner);
+            
+            std::string name_;
+            std::string description_;
+            std::string spawnerTemplate_;
+            StaticEntity* spawnerRepresentation_;
+            
+            Pickupable* pickup_;
+            
+            
+    };
+
+}
+    
+#endif // _PickupRepresentation_H__

Modified: code/branches/pickup3/src/modules/pickup/PickupSpawner.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupSpawner.cc	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/modules/pickup/PickupSpawner.cc	2010-03-05 08:49:56 UTC (rev 6474)
@@ -65,11 +65,7 @@
         this->initialize();
         
         PickupRepresentation* representation = PickupManager::getInstance().getRepresentation(NULL);
-        
-        COUT(1) << "MUP4 " << representation << std::endl;
         this->attach(representation->getSpawnerRepresentation(this));
-        
-        COUT(1) << "MUP6" << std::endl;
     }
 
     /**

Added: code/branches/pickup3/src/modules/pickup/items/CMakeLists.txt
===================================================================
--- code/branches/pickup3/src/modules/pickup/items/CMakeLists.txt	                        (rev 0)
+++ code/branches/pickup3/src/modules/pickup/items/CMakeLists.txt	2010-03-05 08:49:56 UTC (rev 6474)
@@ -0,0 +1,3 @@
+ADD_SOURCE_FILES(PICKUP_SRC_FILES
+  HealthPickup.cc
+)

Added: code/branches/pickup3/src/modules/pickup/items/HealthPickup.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/items/HealthPickup.cc	                        (rev 0)
+++ code/branches/pickup3/src/modules/pickup/items/HealthPickup.cc	2010-03-05 08:49:56 UTC (rev 6474)
@@ -0,0 +1,261 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#include "HealthPickup.h"
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "worldentities/pawns/Pawn.h"
+
+#include <sstream>
+
+namespace orxonox
+{
+    
+    /*static*/ const std::string HealthPickup::healthTypeLimited_s = "limited";
+    /*static*/ const std::string HealthPickup::healthTypeTemporary_s = "temporary";
+    /*static*/ const std::string HealthPickup::healthTypePermanent_s = "permanent";
+    /*static*/ const std::string HealthPickup::blankString_s = "";
+    
+    CreateFactory(HealthPickup);
+    
+    HealthPickup::HealthPickup(BaseObject* creator) : Pickup(creator)
+    {
+        RegisterObject(HealthPickup);
+        
+        this->initialize();
+    }
+    
+    HealthPickup::~HealthPickup()
+    {
+        
+    }
+    
+    void HealthPickup::initialize(void)
+    {
+        RegisterObject(HealthPickup);
+        
+        this->health_ = 0;
+        this->healthSpeed_ = 0;
+        this->healthType_ = pickupHealthType::limited;
+        
+    }
+    
+    void HealthPickup::initializeIdentifier(void)
+    {
+        this->pickupIdentifier_.addClass(this->getIdentifier());
+        
+        std::stringstream stream;
+        stream << this->getHealth();
+        std::string type1 = "health";
+        std::string val1 = stream.str();
+        this->pickupIdentifier_.addParameter(type1, val1);
+        
+        //TODO: Does this work, is val valid outside the function scope?
+        std::string val2 = this->getHealthType();
+        std::string type2 = "healthType";
+        this->pickupIdentifier_.addParameter(type2, val2);
+    }
+    
+    void HealthPickup::HealthPickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
+    {
+        SUPER(HealthPickup, XMLPort, xmlelement, mode);
+        
+        XMLPortParam(HealthPickup, "health", setHealth, getHealth, xmlelement, mode);
+        XMLPortParam(HealthPickup, "healthSpeed", setHealthSpeed, getHealthSpeed, xmlelement, mode);
+        XMLPortParam(HealthPickup, "healthType", setHealthType, getHealthType, xmlelement, mode);
+        
+        if(!this->isContinuous())
+            this->healthSpeed_ = 0.0;
+        
+        this->initializeIdentifier();
+    }
+    
+    void HealthPickup::setHealth(float health)
+    {
+        if(health > 0.0f)
+        {
+            this->health_ = health;
+        }
+        else
+        {
+            COUT(1) << "Invalid health in HealthPickup." << std::endl;
+        }
+    }
+    
+    void HealthPickup::setHealthSpeed(float speed)
+    {
+        if(speed >= 0)
+        {
+            this->healthSpeed_ = speed;
+        }
+        else
+        {
+            COUT(1) << "Invalid healthSpeed in HealthPickup." << std::endl; 
+        }
+    }
+    
+    void HealthPickup::setHealthType(std::string type)
+    {
+        if(type == HealthPickup::healthTypeLimited_s)
+        {
+            this->setHealthTypeDirect(pickupHealthType::limited);
+        }
+        else if(type == HealthPickup::healthTypeTemporary_s)
+        {
+            this->setHealthTypeDirect(pickupHealthType::temporary);
+        }
+        else if(type == HealthPickup::healthTypePermanent_s)
+        {
+            this->setHealthTypeDirect(pickupHealthType::permanent);
+        }
+        else
+        {
+            COUT(1) << "Invalid healthType in HealthPickup." << std::endl;
+        }
+    }
+    
+    void HealthPickup::tick(float dt)
+    {
+        if(this->isContinuous() && this->isUsed())
+        {
+            PickupCarrier* carrier = this->getCarrier();
+            Pawn* pawn = dynamic_cast<Pawn*>(carrier);
+            
+            if(pawn == NULL)
+            {
+                COUT(1) << "Invalid PickupCarrier in HealthPickup." << std::endl;
+                return;
+            }
+            
+            float health = dt*this->getHealthSpeed();
+            if(health > this->getHealth())
+                health = this->getHealth();
+            float fullHealth = pawn->getHealth() + health;
+            this->setHealth(this->getHealth()-health);
+                    
+            switch(this->getHealthTypeDirect())
+            {
+                case pickupHealthType::permanent:
+                    if(pawn->getMaxHealth() > fullHealth)
+                        pawn->setMaxHealth(fullHealth);
+                case pickupHealthType::limited:
+                    pawn->addHealth(health);
+                    break;
+                case pickupHealthType::temporary:
+                    //TODO: How?
+                    break;
+                default:
+                    COUT(1) << "Invalid healthType in HealthPickup." << std::endl;
+            }
+            
+            if(this->getHealth() == 0)
+            {
+                //TODO: Destroy
+            }
+        }
+    }
+    
+    const std::string& HealthPickup::getHealthType(void)
+    {
+        switch(this->getHealthTypeDirect())
+        {
+            case pickupHealthType::limited:
+                return HealthPickup::healthTypeLimited_s;
+            case pickupHealthType::temporary:
+                return HealthPickup::healthTypeTemporary_s;
+            case pickupHealthType::permanent:
+                return HealthPickup::healthTypePermanent_s;
+            default:
+                COUT(1) << "Invalid healthType in HealthPickup." << std::endl;
+                return HealthPickup::blankString_s;
+        }
+    }
+    
+    void HealthPickup::clone(OrxonoxClass* item)
+    {
+        if(item == NULL)
+            item = new HealthPickup(this);
+        
+        SUPER(HealthPickup, clone, item);
+        
+        //TODO: No temp needed?
+        HealthPickup* pickup = dynamic_cast<HealthPickup*>(item);
+        pickup->setHealth(this->getHealth());
+        pickup->setHealthSpeed(this->getHealthSpeed());
+        pickup->setHealthTypeDirect(this->getHealthTypeDirect());
+        
+        pickup->initializeIdentifier();
+    }
+    
+    //TODO: Does this work even if Pickup doesn't implement it?
+    void HealthPickup::changedUsed(void)
+    {
+        SUPER(HealthPickup, changedUsed);
+        
+        if(this->isUsed())
+        {
+            PickupCarrier* carrier = this->getCarrier();
+            Pawn* pawn = dynamic_cast<Pawn*>(carrier);
+            
+            if(pawn == NULL)
+            {
+                COUT(1) << "Invalid PickupCarrier in HealthPickup." << std::endl;
+                return;
+            }
+            
+            if(this->isOnce())
+            {
+                float health = 0;
+                switch(this->getHealthTypeDirect())
+                {
+                    case pickupHealthType::permanent:
+                        health = pawn->getHealth()+this->getHealth();
+                        if(pawn->getMaxHealth() < health)
+                            pawn->setMaxHealth(health);
+                    case pickupHealthType::limited:
+                        pawn->addHealth(this->getHealth());
+                        break;
+                    case pickupHealthType::temporary:
+                        //TODO: How?
+                        break;
+                    default:
+                        COUT(1) << "Invalid healthType in HealthPickup." << std::endl;
+                }
+                
+                //TODO: Destroy.
+            }
+        }
+        else
+        {
+            //TODO: Destroy, but be careful to not destroy before being used.
+        }
+    }
+
+}

Added: code/branches/pickup3/src/modules/pickup/items/HealthPickup.h
===================================================================
--- code/branches/pickup3/src/modules/pickup/items/HealthPickup.h	                        (rev 0)
+++ code/branches/pickup3/src/modules/pickup/items/HealthPickup.h	2010-03-05 08:49:56 UTC (rev 6474)
@@ -0,0 +1,99 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#ifndef _HealthPickup_H__
+#define _HealthPickup_H__
+
+#include "pickup/PickupPrereqs.h"
+
+#include "pickup/Pickup.h"
+#include "tools/interfaces/Tickable.h"
+#include "worldentities/StaticEntity.h"
+
+#include <string>
+
+namespace orxonox {
+    
+    //! Enum for the type of the HealthPickup
+    namespace pickupHealthType
+    {
+        enum Value
+        {
+            limited,
+            temporary,
+            permanent
+        };
+    }
+    
+    class _PickupExport HealthPickup : public Pickup, public Tickable
+    {
+        public:
+        
+            HealthPickup(BaseObject* creator);
+            virtual ~HealthPickup();
+            
+            virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode);
+            virtual void tick(float dt);
+            
+            virtual void clone(OrxonoxClass* item);
+                        
+            virtual void changedUsed(void);
+            
+        protected:
+            void initializeIdentifier(void);
+
+            void setHealth(float health);
+            void setHealthSpeed(float speed);
+            void setHealthType(std::string type);
+            inline void setHealthTypeDirect(pickupHealthType::Value type)
+                { this->healthType_ = type; }
+            
+            inline float getHealth(void)
+                { return this->health_; }
+            inline float getHealthSpeed(void)
+                { return this->healthSpeed_; }
+            const std::string& getHealthType(void);
+            inline pickupHealthType::Value getHealthTypeDirect(void)
+                { return this->healthType_; }
+        
+        private:
+            void initialize(void);
+            
+            float health_;
+            float healthSpeed_;
+            pickupHealthType::Value healthType_;
+            
+            static const std::string healthTypeLimited_s;
+            static const std::string healthTypeTemporary_s;
+            static const std::string healthTypePermanent_s;
+            static const std::string blankString_s; //TODO: Maybe already implemented somewhere?
+        
+    };
+}
+
+#endif // _HealthPickup_H__

Modified: code/branches/pickup3/src/orxonox/interfaces/InterfaceCompilation.cc
===================================================================
--- code/branches/pickup3/src/orxonox/interfaces/InterfaceCompilation.cc	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/interfaces/InterfaceCompilation.cc	2010-03-05 08:49:56 UTC (rev 6474)
@@ -58,7 +58,18 @@
     PickupCarrier::PickupCarrier()
     {
         RegisterRootObject(PickupCarrier);
+        
     }
+    
+    PickupCarrier::~PickupCarrier()
+    {
+        for(std::set<Pickupable*>::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
+        {
+            (*it)->destroy();
+        }
+        
+        this->pickups_.clear();
+    }
 
     //----------------------------
     // PlayerTrigger

Modified: code/branches/pickup3/src/orxonox/interfaces/PickupCarrier.h
===================================================================
--- code/branches/pickup3/src/orxonox/interfaces/PickupCarrier.h	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/interfaces/PickupCarrier.h	2010-03-05 08:49:56 UTC (rev 6474)
@@ -35,31 +35,48 @@
 #define _PickupCarrier_H__
 
 #include "OrxonoxPrereqs.h"
-#include "core/OrxonoxClass.h"
-#include "Pickupable.h"
 
+#include <list>
 #include <set>
-#include <list>
+#include "Pickupable.h"
 
+#include "core/OrxonoxClass.h"
+
 namespace orxonox
 {
 
+    /**
+    @brief
+        The PickupCarrier interface provides the means, for any class implementing it, to possess Pickupables.
+    @author
+        Damian 'Mozork' Frick
+    */
     class _OrxonoxExport PickupCarrier : virtual public OrxonoxClass
     {
-        friend class Pickupable;
+        friend class Pickupable; //!< The Pickupable has full acces to its PickupCarrier.
         
         public:
-            PickupCarrier();
-            virtual ~PickupCarrier() {}
+            PickupCarrier(); //!< Constructor.
+            virtual ~PickupCarrier(); //!< Destructor.
             
-            //TODO: Secure uniqueness of each item in the set, if neccessary, check.
+            /**
+            @brief Can be called to pick up a Pickupable.
+            @param pickup A pointer to the Pickupable.
+            @return Returns true if the Pickupable was picked up, false if not.
+            */
             inline bool pickup(Pickupable* pickup)
                 {
                     bool pickedUp = this->pickups_.insert(pickup).second;
-                    if(pickedUp) pickup->pickedUp(this);
+                    if(pickedUp)
+                        pickup->pickedUp(this);
                     return pickedUp;
                 }
                 
+            /**
+            @brief Can be called to drop a Pickupable.
+            @param pickup A pointer to the Pickupable.
+            @return Returns true if the Pickupable has been dropped, false if not.
+            */
             inline bool drop(Pickupable* pickup)
                 { 
                    bool dropped = this->pickups_.erase(pickup) == 1;

Added: code/branches/pickup3/src/orxonox/interfaces/Pickupable.cc
===================================================================
--- code/branches/pickup3/src/orxonox/interfaces/Pickupable.cc	                        (rev 0)
+++ code/branches/pickup3/src/orxonox/interfaces/Pickupable.cc	2010-03-05 08:49:56 UTC (rev 6474)
@@ -0,0 +1,210 @@
+/*
+ *   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 Implementation of the Pickupable class.
+*/
+
+#include "Pickupable.h"
+
+#include "core/Identifier.h"
+#include "core/CoreIncludes.h"
+#include "PickupCarrier.h"
+
+namespace orxonox
+{
+    
+    /**
+    @brief
+        Constructor. Registers the objects and initializes its member variables.
+    */
+    Pickupable::Pickupable()
+    {
+        RegisterRootObject(Pickupable);
+
+        this->used_ = false;
+        this->pickedUp_ = false;
+        this->carrier_ = NULL;
+    }
+    
+    /**
+    @brief
+        Destructor. 
+    */
+    Pickupable::~Pickupable()
+    {
+        
+    }
+    
+    /**
+    @brief
+        Sets the Pickupable to used or unused, depending on the input.
+    @param used
+        If used is true the Pickupable is set to used, it is set to unused, otherwise.
+    @return
+        Returns true if the used state was changed, false if not.
+    */
+    bool Pickupable::setUsed(bool used)
+    {
+        if(this->used_ == used)
+            return false;
+        
+        COUT(4) << "Pickupable (&" << this << ") set to used " << used << "." << std::endl;
+        
+        this->used_ = used;
+        this->changedUsed();
+        return true;
+    }
+    
+    /**
+    @brief
+        Get whether the given PickupCarrier is a target of this pickup.
+    @param carrier
+        The PickupCarrier of which it has to be determinde whether it is a target of this pickup.
+    @return
+        Returns true if the given PickupCarrier is a target.
+    */
+    bool Pickupable::isTarget(PickupCarrier* carrier)
+    {
+        Identifier* identifier = carrier->getIdentifier();
+        //! Iterate through all targets of this Pickupable.
+        for(std::list<Identifier*>::const_iterator it = this->targets_.begin(); it != this->targets_.end(); it++)
+        {
+            if(identifier->isA(*it))
+                return true;
+        }
+        return false;
+    }
+    
+    /**
+    @brief
+        Add a PickupCarrier as target of this pickup.
+    @param target
+        The PickupCarrier to be added.
+    @return
+        Returns true if the target was added, false if not.
+    */
+    bool Pickupable::addTarget(PickupCarrier* target)
+    {
+        if(this->isTarget(target)) //!< If the input target is already present in the list of targets.
+            return false;
+        
+        COUT(4) << "Target (&" << target << ") added to Pickupable (&" << this << ")." << std::endl;
+        this->targets_.push_back(target->getIdentifier());
+        return true;
+    }
+    
+    /**
+    @brief  
+        Sets the Pickupable to picked up.
+        This method will be called by the PickupCarrier picking the Pickupable up.
+    @param carrier
+        The PickupCarrier that picked the Pickupable up.
+    @return
+        Returns false if, for some reason, the pickup could not be picked up, e.g. it was picked up already.
+    */
+    bool Pickupable::pickedUp(PickupCarrier* carrier)
+    {
+        if(this->isPickedUp()) //!< If the Pickupable is already picked up.
+            return false;
+        
+        COUT(4) << "Pickupable (&" << this << ") got picked up by a PickupCarrier (&" << carrier << ")." << std::endl;
+        this->setCarrier(carrier);
+        this->setPickedUp(true);
+        return true;
+    }
+    
+    /**
+    @brief 
+        Sets the Pickupable to not picked up or dropped.
+        This method will be called by the PickupCarrier dropping the Pickupable.
+    @return
+        Returns false if the pickup could not be dropped.
+    */
+    bool Pickupable::dropped(void)
+    {
+        if(!this->isPickedUp()) //!< If the Pickupable is not picked up.
+            return false;
+        
+        COUT(4) << "Pickupable (&" << this << ") got dropped up by a PickupCarrier (&" << this->getCarrier() << ")." << std::endl;
+        this->setUsed(false);
+        this->setPickedUp(false);
+        this->setCarrier(NULL);
+        return true;
+    }
+    
+        
+    /**
+    @brief
+        Sets the carrier of the pickup.
+    @param carrier
+        Sets the input PickupCarrier as the carrier of the pickup.
+    @return
+        Returns true if the carrier was changed, false if not.
+    */
+    bool Pickupable::setCarrier(PickupCarrier* carrier)
+    {
+        if(this->getCarrier() == carrier)
+            return false;
+        
+        this->carrier_ = carrier;
+        this->changedCarrier();
+        return true;
+    }
+    
+    /**
+    @brief
+        Creates a duplicate of the Pickupable.
+    @return
+        Returns the clone of this pickup as a pointer to a Pickupable.
+    */
+    //TODO: Does this work?
+    Pickupable* Pickupable::clone(void)
+    {
+        Pickupable* pickup = NULL;
+        this->clone(pickup);
+        
+        COUT(4) << "Pickupable (&" << this << ") cloned. Clone is new Pickupable (&" << pickup << ")." << std::endl;
+        return pickup;
+    }
+    
+    /**
+    @brief
+        Creates a duplicate of the input OrxonoxClass.
+        This method needs to be implemented by any Class inheriting from Pickupable.
+    @param item
+        A pointer to the OrxonoxClass that is to be duplicated.
+    */
+    //TODO: Specify how the implementation must be done in detail.
+    void Pickupable::clone(OrxonoxClass* item)
+    {
+        SUPER(Pickupable, clone, item);
+    }
+    
+}

Modified: code/branches/pickup3/src/orxonox/interfaces/Pickupable.h
===================================================================
--- code/branches/pickup3/src/orxonox/interfaces/Pickupable.h	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/interfaces/Pickupable.h	2010-03-05 08:49:56 UTC (rev 6474)
@@ -35,18 +35,19 @@
 #define _Pickupable_H__
 
 #include "OrxonoxPrereqs.h"
-#include "core/OrxonoxClass.h"
 
+#include <list>
 #include "core/Super.h"
 #include "pickup/PickupIdentifier.h"
-#include <list>
 
+#include "core/OrxonoxClass.h"
+
 namespace orxonox
 {
     
     /**
     @brief
-        An Interface (or more precisely an abstract Class) to model and represent different (all kinds of) pickups.
+        An Interface (or more precisely an abstract class) to model and represent different (all kinds of) pickups.
     @author
         Damian 'Mozork' Frick
     */
@@ -56,67 +57,83 @@
         
         public:
             Pickupable(); //!< Default constructor.
-            virtual ~Pickupable() {} //!< Default destructor.
-                
+            virtual ~Pickupable(); //!< Default destructor.
+            
             /**
-            @brief Get the carrier of the pickup.
-            @return Returns a pointer to the carrier of the pickup.
-            */
-            inline PickupCarrier* getCarrier(void)
-                { return this->carrier_; }
-                
-            /**
             @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_; }
-                
-            bool isTarget(PickupCarrier* carrier);
-            bool addTarget(PickupCarrier* target);
-
-            bool setUsed(bool used);
+            /**
+            @brief  Should be called when the pickup has transited 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 changdeUsed method.
+            */
+            virtual void changedUsed(void) {}
+            bool setUsed(bool used); //!< Sets the Pickupable to used or unused, depending on the input.
             
-            bool pickedUp(PickupCarrier* carrier);
-            bool dropped(void);
-            
+            /**
+            @brief Returns whether the Pickupable is currently picked up.
+            @return Returns true if the Pickupable is currently picked up, false if not.
+            */
             inline bool isPickedUp(void)
                 { return this->pickedUp_; }
+            //TODO: Better private, or protected?
+            bool pickedUp(PickupCarrier* carrier); //!< Sets the Pickupable to picked up.
+            bool dropped(void); //!< Sets the Pickupable to not picked up or dropped.
             
-            Pickupable* clone(void);
+            bool isTarget(PickupCarrier* carrier); //!< Get whether the given PickupCarrier is a target of this pickup.
+            bool addTarget(PickupCarrier* target); //!< Add a PickupCarrier as target of this pickup.
             
-            virtual const PickupIdentifier* getPickupIdentifier(void)
-                { return &this->pickupIdentifier_; }
-                
-            virtual void clone(OrxonoxClass* item);
-            
             /**
-            @brief  Should be called when the pickup has transited 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 changdeUsed method.
+            @brief Get the carrier of the pickup.
+            @return Returns a pointer to the carrier of the pickup.
             */
-            virtual void changedUsed(void) {}
-            
+            inline PickupCarrier* getCarrier(void)
+                { return this->carrier_; }
             /**
             @brief  Should be called when the pickup has transited from picked up to dropped or the other way around.
                     Any Class overwriting this method must call its SUPER function by adding SUPER(Classname, changedCarrier); to their changedCarrier method.
             */
             virtual void changedCarrier(void) {}
+            //TODO: Maybe private?
+            bool setCarrier(PickupCarrier* carrier); //!< Sets the carrier of the pickup.
             
-            bool setCarrier(PickupCarrier* carrier);
+            Pickupable* clone(void); //!< Creates a duplicate of the Pickupable.
+            virtual void clone(OrxonoxClass* item); //!< Creates a duplicate of the input OrxonoxClass.
             
+            /**
+            @brief Get the PickupIdentifier of this Pickupable.
+            @return Returns a pointer to the PickupIdentifier of this Pickupable.
+            */
+            virtual const PickupIdentifier* getPickupIdentifier(void)
+                { return &this->pickupIdentifier_; }
+                
+            virtual void destroy(void)
+                { delete this; }
+            
         protected:
+            /**
+            @brief Helper method to initialize the PickupIdentifier.
+            */
+            //TODO: Really needed?
             void initializeIdentifier(void) {}
             
-            PickupIdentifier pickupIdentifier_;
+            //TODO: Move to private and create get method in protected.
+            PickupIdentifier pickupIdentifier_; //!< The PickupIdentifier of this Pickupable.
             
         private:
+            /**
+            @brief Helper method to set the Pickupable to either picked up or not picked up.
+            @param pickedUp The value this->pickedUp_ should be set to.
+            */
             inline void setPickedUp(bool pickedUp)
                 { this->pickedUp_ = pickedUp; }
             
             bool used_; //!< Whether the pickup is currently in use or not.
             bool pickedUp_; //!< Whether the pickup is currently picked up or not.
             
-            PickupCarrier* carrier_; //!< The owner of the pickup.
+            PickupCarrier* carrier_; //!< The carrier of the pickup.
             std::list<Identifier*> targets_; //!< The possible targets of this pickup.
 
     };

Deleted: code/branches/pickup3/src/orxonox/pickup/BaseItem.cc
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/BaseItem.cc	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/pickup/BaseItem.cc	2010-03-05 08:49:56 UTC (rev 6474)
@@ -1,109 +0,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 BaseItem (base-class for items/pickups).
-*/
-
-#include "BaseItem.h"
-
-#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "worldentities/pawns/Pawn.h"
-
-namespace orxonox
-{
-    /**
-    @brief Constructor. Registers the BaseItem.
-    @param creator Pointer to the object which created this item.
-    */
-    BaseItem::BaseItem(BaseObject* creator) : BaseObject(creator)
-    {
-        RegisterObject(BaseItem);
-
-        this->setOwner(0);
-        this->setPickupIdentifier(this->getName());
-        this->setGUIImage("");
-        this->setGUIText("");
-    }
-    //! Destructor.
-    BaseItem::~BaseItem()
-    {
-    }
-
-    /**
-    @brief XMLPort for BaseItem.
-    @param xmlelement Element of the XML-file.
-    @param mode XMLPort mode to use.
-    */
-    void BaseItem::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        SUPER(BaseItem, XMLPort, xmlelement, mode);
-
-        XMLPortParam(BaseItem, "guiText", setGUIText, getGUIText, xmlelement, mode);
-        XMLPortParam(BaseItem, "guiImage", setGUIImage, getGUIImage, xmlelement, mode);
-    }
-
-    /**
-    @brief Method to add the item to a pawn.
-    @param pawn Pawn to which the item should get added.
-    @return Returns whether the pawn's PickupCollection accepted the item.
-    */
-    bool BaseItem::addTo(Pawn* pawn)
-    {
-        this->setOwner(pawn);
-
-        if (pawn->getPickups().add(this)) //TODO: Does the pawn store his pickups?
-        {
-            COUT(3) << "Added '" << this->getPickupIdentifier() << "' item." << std::endl;
-            return true;
-        }
-        return false;
-    }
-    /**
-        @brief Removes the item from a pawn.
-        @param pawn Pawn from which to remove the item.
-        @return Returns whether the pawn's PickupCollection was able to locate and remove the item.
-    */
-    bool BaseItem::removeFrom(Pawn* pawn)
-    {
-        this->setOwner(0);
-
-        COUT(3) << "Removing '" << this->getPickupIdentifier() << "' item." << std::endl;
-
-        pawn->getPickups().remove(this, false);
-
-        return true;
-    }
-
-    const std::string& BaseItem::getGUIText() const
-    {
-        return this->guiText_;
-    }
-}

Deleted: code/branches/pickup3/src/orxonox/pickup/BaseItem.h
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/BaseItem.h	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/pickup/BaseItem.h	2010-03-05 08:49:56 UTC (rev 6474)
@@ -1,156 +0,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 BaseItem (base-class for items/pickups).
-*/
-
-#ifndef _BaseItem_H__
-#define _BaseItem_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include <string>
-#include "core/BaseObject.h"
-
-// tolua_begin
-namespace orxonox
-{
-    /**
-    @brief
-        Base class for all items/pickups.
-
-        Provides common methods to be used in derived classes.
-    @author
-        Daniel 'Huty' Haggenmueller
-    */
-    class _OrxonoxExport BaseItem : public BaseObject
-    {
-// tolua_end
-        public:
-            BaseItem(BaseObject* creator);
-            virtual ~BaseItem();
-
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);  //!< XMLPort
-
-            /**
-            @brief Checks how many instances of this item can be carried at a time.
-            @return How many of this item can be carried.
-            */
-            virtual int getMaxCarryAmount() const //TODO: Maybe, better to just be virtual.
-                { return BaseItem::MAX_CARRY_AMOUNT; }
-
-            //TODO: Need to be public?
-            bool addTo(Pawn* pawn);             //!< Add the item to a pawn.
-            bool removeFrom(Pawn* pawn);        //!< Removes the item from a pawn.
-            /**
-            @brief
-                Method invoked when the item gets picked up.
-
-                Has to be overridden for an item to work,
-                should contain a call to addTo().
-
-            @param pawn Pawn who picks up the item.
-            @return Returns whether the pawn was able to pick up the item.
-            */
-            virtual bool pickedUp(Pawn* pawn) //TODO: Maybe better to be just virtual.
-                { return false; }
-            /**
-            @brief
-                Method invoked when the item is dropped from a player.
-
-                Should be overridden by derived classes,
-                should also contain a call to removeFrom().
-
-            @param pawn Pawn which dropped the item.
-            @return Returns whether the item was able to get dropped by the pawn.
-            */
-            virtual bool dropped(Pawn* pawn)
-                { return false; }
-
-            /**
-            @brief Gets the current owner of the pickup.
-            @return Returns the current owner.
-            */
-            inline Pawn* getOwner() const
-                { return this->owner_; }
-            /**
-            @brief Sets the owner of the pickup.
-            @param owner New owner for the pickup.
-            */
-            inline void setOwner(Pawn* owner)
-                { this->owner_ = owner; }
-
-            /**
-            @brief Gets the pickupIdentifier of the item.
-            @return Returns the pickupIdentifier of the item.
-            @see pickupIdentifier_
-            */
-            inline const std::string& getPickupIdentifier() const
-                { return this->pickupIdentifier_; }
-            /**
-            @brief Sets the pickupIdentifier for the item.
-            @param identifier New pickupIdentifier for the item.
-            @see pickupIdentifier_
-            */
-            //TODO: Needs to be public?
-            inline void setPickupIdentifier(const std::string& identifier)
-                { this->pickupIdentifier_ = identifier; }
-
-            // GUI stuff
-            //TODO: Comment. Maybe seperate GUI from Pickup, e.g. ItemDescription...
-            virtual const std::string& getGUIText() const; // tolua_export
-            inline void setGUIText(const std::string& text)
-                { this->guiText_ = text; }
-
-            virtual const std::string& getGUIImage() const
-                { return this->guiImage_; }
-            inline void setGUIImage(const std::string& image)
-                { this->guiImage_ = image; }
-        private:
-            static const int MAX_CARRY_AMOUNT = 1;
-
-            Pawn* owner_;   //!< The current owner of the item.
-
-            /**
-            @brief
-                The pickupIdentifier of the item..
-
-                Usually set to the template name used by a PickupSpawner,
-                used to index items in the PickupCollection.
-            */
-            std::string pickupIdentifier_; //TODO: Remove, when always just this->getName().
-
-            //TODO: Comment.
-            std::string guiText_;
-            std::string guiImage_;
-    }; // tolua_export
-} // tolua_export
-
-#endif /* _BaseItem_H__ */

Deleted: code/branches/pickup3/src/orxonox/pickup/DroppedItem.cc
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/DroppedItem.cc	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/pickup/DroppedItem.cc	2010-03-05 08:49:56 UTC (rev 6474)
@@ -1,123 +0,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);
-
-    DroppedItem::DroppedItem(BaseObject* creator) : StaticEntity(creator)
-    {
-        RegisterObject(DroppedItem);
-
-        this->triggerDistance_ = 20.0f;
-        this->timeToLive_ = 0;
-        this->item_ = 0;
-    }
-    DroppedItem::~DroppedItem()
-    {
-    }
-    void DroppedItem::tick(float dt)
-    {
-        if (this->item_)
-        {
-            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);
-            }
-        }
-    }
-    void DroppedItem::trigger(Pawn* pawn)
-    {
-        if (this->item_->pickedUp(pawn))
-        {
-            COUT(3) << "DroppedItem '" << this->item_->getPickupIdentifier() << "' picked up." << std::endl;
-            this->destroy();
-        }
-    }
-    void DroppedItem::createTimer()
-    {
-        if (this->timeToLive_ > 0)
-        {
-            this->timer_.setTimer(this->timeToLive_, false, createExecutor(createFunctor(&DroppedItem::timerCallback, this)), false);
-        }
-    }
-    void DroppedItem::timerCallback()
-    {
-        if (this->item_)
-        {
-            COUT(3) << "Delete DroppedItem with '" << this->item_->getPickupIdentifier() << '\'' << std::endl;
-            this->item_->destroy();
-        }
-
-        this->destroy();
-    }
-
-    DroppedItem* DroppedItem::createDefaultDrop(BaseItem* item, const Vector3& position, const ColourValue& flareColour, float timeToLive)
-    {
-        DroppedItem* drop = new DroppedItem(item);
-        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);
-
-        drop->setPosition(position);
-        drop->attach(model);
-        drop->attach(billboard);
-
-        drop->setItem(item);
-
-        drop->setTimeToLive(timeToLive);
-        drop->createTimer();
-
-        COUT(3) << "Created DroppedItem for '" << item->getPickupIdentifier() << "' at (" << position.x << ',' << position.y << ',' << position.z << ")." << std::endl;
-
-        return drop;
-    }
-    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);
-    }
-}

Deleted: code/branches/pickup3/src/orxonox/pickup/EquipmentItem.cc
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/EquipmentItem.cc	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/pickup/EquipmentItem.cc	2010-03-05 08:49:56 UTC (rev 6474)
@@ -1,47 +0,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 EquipmentItem.
-*/
-
-#include "EquipmentItem.h"
-#include "core/CoreIncludes.h"
-
-namespace orxonox
-{
-    /**
-    @brief Constructor. Registers the EquipmentItem.
-    @param creator Pointer to the object which created this item.
-    */
-    EquipmentItem::EquipmentItem(BaseObject* creator) : BaseItem(creator)
-    {
-        RegisterObject(EquipmentItem);
-    }
-}

Deleted: code/branches/pickup3/src/orxonox/pickup/EquipmentItem.h
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/EquipmentItem.h	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/pickup/EquipmentItem.h	2010-03-05 08:49:56 UTC (rev 6474)
@@ -1,59 +0,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 EquipmentItem (base-class for equipment-type items).
-*/
-
-#ifndef _EquipmentPickup_H__
-#define _EquipmentPickup_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "BaseItem.h"
-namespace orxonox
-{
-    /**
-    @brief Base class for all equipment-type items.
-    @author Daniel 'Huty' Haggenmueller
-    */
-    class _OrxonoxExport EquipmentItem : public BaseItem
-    {
-        //TODO: What is this class for?
-        //Probably falls under UsableItem or PassiveItem
-        public:
-            EquipmentItem(BaseObject* creator);
-            virtual ~EquipmentItem() {}
-
-        
-
-    };
-}
-
-#endif /* _EquipmentPickup_H__ */

Deleted: code/branches/pickup3/src/orxonox/pickup/ModifierPickup.cc
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/ModifierPickup.cc	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/pickup/ModifierPickup.cc	2010-03-05 08:49:56 UTC (rev 6474)
@@ -1,242 +0,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 ModifierPickup (temporary(?) pickup for testing).
-*/
-
-#include "ModifierPickup.h"
-
-#include "core/CoreIncludes.h"
-#include "core/XMLPort.h"
-#include "worldentities/pawns/Pawn.h"
-
-namespace orxonox
-{
-    CreateFactory(ModifierPickup);
-
-    /**
-    @brief
-        Constructor. Registers the ModifierPickup.
-    @param creator
-        Pointer to the object which created this item.
-    */
-    ModifierPickup::ModifierPickup(BaseObject* creator) : PassiveItem(creator)
-    {
-        RegisterObject(ModifierPickup);
-
-        this->duration_ = 0.0f;
-    }
-
-    /**
-    @brief
-        Destructor.
-    */
-    ModifierPickup::~ModifierPickup()
-    {
-        
-    }
-
-    /**
-    @brief
-        Method for loading information from a level file.
-    @param element
-        XMLElement from which to read the data.
-    @param mode
-        XMLPort mode to use.
-    */
-    //TODO: Comments: params can probably be ommitted. 
-    void ModifierPickup::XMLPort(Element& element, XMLPort::Mode mode)
-    {
-        SUPER(ModifierPickup, XMLPort, element, mode);
-
-        XMLPortParam(ModifierPickup, "duration", setDuration, getDuration, element, mode);
-
-        XMLPortParamTemplate(ModifierPickup, "damageAdd", setAdditiveDamage, getAdditiveDamage, element, mode, float);
-        XMLPortParamTemplate(ModifierPickup, "damageMulti", setMultiplicativeDamage, getMultiplicativeDamage, element, mode, float);
-
-        XMLPortParamTemplate(ModifierPickup, "accelerationAdd", setAdditiveAcceleration, getAdditiveAcceleration, element, mode, float);
-        XMLPortParamTemplate(ModifierPickup, "accelerationMulti", setMultiplicativeAcceleration, getMultiplicativeAcceleration, element, mode, float);
-    }
-
-    /**
-    @brief
-        Invoked when a pawn picks up the pickup.
-
-        Adds the modifiers to the pawn and sets a timer (if effect is limited)
-        if the pickup could be added to the pawn's PickupCollection.
-
-    @param pawn
-        Pawn which picked up the pickup.
-    @return
-        Returns whether the pickup was able to be added to the pawn.
-    */
-    bool ModifierPickup::pickedUp(Pawn* pawn)
-    {
-        if (this->addTo(pawn))
-        {
-            std::map<ModifierType::Value, float>::iterator it;
-
-            for (it = this->additiveModifiers_.begin(); it != this->additiveModifiers_.end(); it++)
-            {
-                pawn->getPickups().addAdditiveModifier(it->first, it->second);
-            }
-
-            for (it = this->multiplicativeModifiers_.begin(); it != this->multiplicativeModifiers_.end(); it++)
-            {
-                pawn->getPickups().addMultiplicativeModifier(it->first, it->second);
-            }
-
-            if (this->duration_ > 0.0f)
-            {
-                Executor* executor = createExecutor(createFunctor(&ModifierPickup::timerCallback, this));
-                executor->setDefaultValues(pawn);
-                this->timer_.setTimer(this->duration_, false, executor);
-            }
-
-            return true;
-        }
-        return false;
-    }
-
-    /**
-    @brief
-        Invoked when a pawn drops the pickup.
-
-        Removes the modifiers from the pawn if the pickup
-        was successfully removed from it's PickupCollection.
-
-    @param pawn
-        Pawn which dropped the pickup.
-    @return 
-        Returns whether the pickup could be removed.
-    */
-    bool ModifierPickup::dropped(Pawn* pawn)
-    {
-        if (this->removeFrom(pawn))
-        {
-            std::map<ModifierType::Value, float>::iterator it;
-
-            for (it = this->additiveModifiers_.begin(); it != this->additiveModifiers_.end(); it++)
-            {
-                pawn->getPickups().removeAdditiveModifier(it->first, it->second);
-            }
-
-            for (it = this->multiplicativeModifiers_.begin(); it != this->multiplicativeModifiers_.end(); it++)
-            {
-                pawn->getPickups().removeMultiplicativeModifier(it->first, it->second);
-            }
-
-            if (this->timer_.getRemainingTime() > 0.0f)
-                this->timer_.stopTimer();
-
-            this->destroy();
-
-            return true;
-        }
-        return false;
-    }
-
-    /**
-    @brief Invoked when the timer finished, calls dropped().
-    */
-    //TODO: Other name for function?
-    void ModifierPickup::timerCallback(Pawn* pawn)
-    {
-        if (!this->dropped(pawn))
-            COUT(2) << "Failed to remove modifier pickup after the timer ran out!" << std::endl;
-    }
-
-    /**
-    @brief
-        Gets the additive modifier of a given type.
-    @param type
-        ModifierType for which to return the modifier.
-    @return
-        Returns the additive modifier for type (or 0 if not exists).
-    */
-    float ModifierPickup::getAdditiveModifier(ModifierType::Value type) const
-    {
-        std::map<ModifierType::Value, float>::const_iterator it = this->additiveModifiers_.find(type);
-        if (it != this->additiveModifiers_.end())
-            return it->second;
-        else
-            return 0.0f;
-    }
-
-    /**
-    @brief
-        Gets the multiplicative modifier of a given type.
-    @param type
-        ModifierType for which to return the modifier.
-    @return
-        Returns the multiplicative modifier for type (or 1 if not exists).
-    */
-    float ModifierPickup::getMultiplicativeModifier(ModifierType::Value type) const
-    {
-        std::map<ModifierType::Value, float>::const_iterator it = this->multiplicativeModifiers_.find(type);
-        if (it != this->multiplicativeModifiers_.end())
-            return it->second;
-        else
-            return 1.0f;
-    }
-
-    /**
-    @brief
-        Gets the additive modifier of a given type.
-    @param type
-        ModifierType for which to return the modifier.
-    @param value
-        The new additive modifier for type.
-    */
-    void ModifierPickup::setAdditiveModifier(ModifierType::Value type, float value)
-    {
-        if (this->additiveModifiers_.find(type) == this->additiveModifiers_.end())
-            this->additiveModifiers_.insert( std::pair<ModifierType::Value, float>(type, value) );
-        else
-            this->additiveModifiers_[type] = value;
-    }
-
-    /**
-    @brief
-        Gets the multiplicative modifier of a given type.
-    @param type
-        ModifierType for which to return the modifier.
-    @param value
-        The new multiplicative modifier for type.
-    */
-    void ModifierPickup::setMultiplicativeModifier(ModifierType::Value type, float value)
-    {
-        if (this->multiplicativeModifiers_.find(type) == this->multiplicativeModifiers_.end())
-            this->multiplicativeModifiers_.insert( std::pair<ModifierType::Value, float>(type, value) );
-        else
-            this->multiplicativeModifiers_[type] = value;
-    }
-
-}

Deleted: code/branches/pickup3/src/orxonox/pickup/ModifierPickup.h
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/ModifierPickup.h	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/pickup/ModifierPickup.h	2010-03-05 08:49:56 UTC (rev 6474)
@@ -1,159 +0,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 ModifierPickup (temporary(?) pickup for testing).
-*/
-
-#ifndef _ModifierPickup_H__
-#define _ModifierPickup_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include <climits>
-#include <map>
-
-#include "tools/Timer.h"
-#include "ModifierType.h"
-#include "PassiveItem.h"
-
-namespace orxonox
-{
-    /**
-    @brief Class for a (temporary) modifier effect.
-    @author Daniel 'Huty' Haggenmueller
-    */
-    //TODO: More elaborate comments.
-    class _OrxonoxExport ModifierPickup : public PassiveItem
-    {
-        //TODO: What does being derived from PassiveItem add exactly? Probably better to kill PassiveItem and just derive from BaseItem.
-        //Include ModifierType here, no additional header file needed for that, imo.
-        public:
-            ModifierPickup(BaseObject* creator);
-            virtual ~ModifierPickup();
-
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< To create a ModifierPickup through the level file.
-
-            virtual bool pickedUp(Pawn* pawn); //!< Override of the BaseItem::pickedUp() method.
-            virtual bool dropped(Pawn* pawn); //!< Override of the BaseItem::dropped() method
-
-            //TODO: Where does this INT_MAX come from? Comment.
-            virtual int getMaxCarryAmount() //!< Allow the player to carry infinite ModPickups
-                { return INT_MAX; }
-
-            /**
-            @brief Get the duration of this pickup.
-            @return Returns how long the effect holds on.
-            */
-            inline float getDuration() const
-                { return this->duration_; }
-            /**
-            @brief Set the duration of this pickup.
-            @param duration How long the effect should hold.
-            */
-            //TODO: Better be private?
-            inline void setDuration(float duration)
-                { this->duration_ = duration; }
-
-            //TODO: Shouldn't these all be seperate pickup items? But, then, would this class really be needed? What does it actually add?
-            //Duration! Thus create two virtual functions addEffect() and removeEffect().
-            //Export the ideas here into seperate, individual subclasses.
-            //Shouldn't this, as an item be in the items folder? or is it, as merely the equivalent of an abstract class not specific enough?
-            //Specify what ModifierItem should do exactly. If the limited duration is the core functionality, another name would probably more fitting.
-            //Perhaps, limited effect duration could also just be another feature of BaseItem...
-            /**
-            @brief Get the amount of damage this pickup adds.
-            @return Returns how much damage this pickup adds.
-            */
-            inline float getAdditiveDamage() const
-                { return this->getAdditiveModifier(ModifierType::Damage); }
-            /**
-            @brief Get the factor by which this pickup multiplies the damage.
-            @return Returns the factor by which to multiply damage.
-            */
-            inline float getMultiplicativeDamage() const
-                { return this->getMultiplicativeModifier(ModifierType::Damage); }
-
-            /**
-            @brief Set the amount of damage this pickup adds.
-            @param value How much damage this pickup adds.
-            */
-            inline void setAdditiveDamage(float value)
-                { this->setAdditiveModifier(ModifierType::Damage, value); }
-            /**
-            @brief Set the factor by which this pickup multiplies the damage.
-            @param value Factor by which to multiply damage.
-            */
-            inline void setMultiplicativeDamage(float value)
-                { this->setMultiplicativeModifier(ModifierType::Damage, value); }
-
-            /**
-            @brief Get the amount of acceleration this pickup adds.
-            @return Returns how much acceleration this pickup adds.
-            */
-            inline float getAdditiveAcceleration() const
-                { return this->getAdditiveModifier(ModifierType::Acceleration); }
-            /**
-            @brief Get the factor by which this pickup multiplies the acceleration.
-            @return Returns the factor by which to multiply acceleration.
-            */
-            inline float getMultiplicativeAcceleration() const
-                { return this->getMultiplicativeModifier(ModifierType::Acceleration); }
-
-            /**
-            @brief Set the amount of acceleration this pickup adds.
-            @param value How much acceleration this pickup adds.
-            */
-            inline void setAdditiveAcceleration(float value)
-                { this->setAdditiveModifier(ModifierType::Acceleration, value); }
-            /**
-            @brief Set the factor by which this pickup multiplies the acceleration.
-            @param value Factor by which to multiply acceleration.
-            */
-            inline void setMultiplicativeAcceleration(float value)
-                { this->setMultiplicativeModifier(ModifierType::Acceleration, value); }
-
-            //TODO: Make private?
-            void timerCallback(Pawn* pawn);     //!< Method called when the timer runs out.
-
-        private:
-            float getAdditiveModifier(ModifierType::Value type) const;               //!< Get the additive modifier for a given ModifierType.
-            float getMultiplicativeModifier(ModifierType::Value type) const;         //!< Get the multiplicative modifier for a given ModifierType.
-            void setAdditiveModifier(ModifierType::Value type, float value);         //!< Set the additive modifier for a given ModifierType.
-            void setMultiplicativeModifier(ModifierType::Value type, float value);   //!< Set the multiplicative modifier for a given ModifierType
-
-            std::map<ModifierType::Value, float> additiveModifiers_;                 //!< Map of additive modifiers, indexed by ModifierType.
-            std::map<ModifierType::Value, float> multiplicativeModifiers_;           //!< Map of multiplicative modifiers, indexed by ModifierType.
-
-            float duration_;                                                         //!< Duration of this pickup's effect (0 for unlimited).
-            Timer timer_;                                                            //!< Timer used if the pickup's effect has a time limit.
-    };
-}
-
-#endif /* _ModifierPickup_H__ */

Deleted: code/branches/pickup3/src/orxonox/pickup/ModifierType.h
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/ModifierType.h	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/pickup/ModifierType.h	2010-03-05 08:49:56 UTC (rev 6474)
@@ -1,56 +0,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 Contains enumeration for different types of modifiers.
-*/
-
-#ifndef _ModifierType_H__
-#define _ModifierType_H__
-
-#include "OrxonoxPrereqs.h"
-
-namespace orxonox
-{
-    //TODO: Merge with ModifierPickup.
-    namespace ModifierType
-    {
-        /**
-            @brief Gives the available types for modifiers.
-        */
-        enum Value
-        {
-            Unknown = 0,
-            Damage,
-            Acceleration
-        };
-    }
-}
-
-#endif /* _ModifierType_H__ */

Deleted: code/branches/pickup3/src/orxonox/pickup/PassiveItem.cc
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/PassiveItem.cc	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/pickup/PassiveItem.cc	2010-03-05 08:49:56 UTC (rev 6474)
@@ -1,42 +0,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 "PassiveItem.h"
-#include "core/CoreIncludes.h"
-
-namespace orxonox
-{
-    /**
-    @brief Constructor. Registers the PassiveItem.
-    @param creator Pointer to the object which created this item.
-    */
-    PassiveItem::PassiveItem(BaseObject* creator) : BaseItem(creator)
-    {
-        RegisterObject(PassiveItem);
-    }
-}

Deleted: code/branches/pickup3/src/orxonox/pickup/PassiveItem.h
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/PassiveItem.h	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/pickup/PassiveItem.h	2010-03-05 08:49:56 UTC (rev 6474)
@@ -1,57 +0,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 PassiveItem (base class for passive items).
-*/
-
-#ifndef _PassiveItem_H__
-#define _PassiveItem_H__
-
-#include "OrxonoxPrereqs.h"
-#include "BaseItem.h"
-
-namespace orxonox
-{
-    /**
-    @brief Base class for all passive items.
-    @author Daniel 'Huty' Haggenmueller
-    */
-    class _OrxonoxExport PassiveItem : public BaseItem
-    {
-        //TODO: What is this Class for. Where is ActiveItem?
-        //Rename it InstantItem?
-        public:
-            PassiveItem(BaseObject* creator);
-            virtual ~PassiveItem() {}
-
-    };
-}
-
-#endif /* _PassiveItem_H__ */

Deleted: code/branches/pickup3/src/orxonox/pickup/PickupCollection.cc
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/PickupCollection.cc	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/pickup/PickupCollection.cc	2010-03-05 08:49:56 UTC (rev 6474)
@@ -1,379 +0,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 PickupCollection.
-*/
-
-#include "PickupCollection.h"
-
-#include "core/CoreIncludes.h"
-#include "EquipmentItem.h"
-#include "PassiveItem.h"
-#include "UsableItem.h"
-
-namespace orxonox
-{
-    typedef std::pair<std::multimap<std::string, BaseItem*>::iterator, std::multimap<std::string, BaseItem*>::iterator> item_range;
-    typedef std::pair<std::multimap<ModifierType::Value, float>::iterator, std::multimap<ModifierType::Value, float>::iterator> modifier_range;
-
-    //! Constructor
-    PickupCollection::PickupCollection()
-    {
-        this->bBlockRemovals_ = false;
-        this->currentUsable_ = NULL;
-    }
-
-    /**
-    @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)
-    {
-        if (this->checkSlot(item))
-        {
-            Identifier* ident = Class(UsableItem);
-            if(this->currentUsable_ == NULL && item->isA(ident))
-                this->currentUsable_ = orxonox_cast<UsableItem*>(item);
-
-            this->items_.insert( std::pair<std::string, BaseItem*> (item->getPickupIdentifier(), item) );
-            return true;
-        }
-        else
-            return false;
-    }
-    /**
-        @brief
-            Check if there's a free slot for an item.
-
-            Compares the amount of the item-type in the collection
-            against the maximal amount of the item that can be carried.
-
-        @param item Item to check for a slot.
-        @return Returns if there's a free slot for the item.
-    */
-    bool PickupCollection::checkSlot(BaseItem* item)
-    {
-        return (static_cast<int>(this->items_.count(item->getPickupIdentifier())) < item->getMaxCarryAmount());
-    }
-    /**
-        @brief
-            Empty the collection.
-
-            Calls dropped() on all the items in the collection,
-            then clears the collection.
-    */
-    void PickupCollection::clear()
-    {
-        this->bBlockRemovals_ = true;
-        for (std::multimap<std::string, BaseItem*>::iterator it = this->items_.begin(); it != this->items_.end(); it++)
-        {
-            if(it->second && it->second->getOwner())
-                it->second->dropped(it->second->getOwner());
-        }
-        this->currentUsable_ = NULL;
-        this->items_.clear();
-        this->bBlockRemovals_ = false;
-    }
-    /**
-        @brief Check if an item/type of item is in the collection.
-        @param item Item to check.
-        @param anyOfType If it should look for any item of the item's type (default: false).
-        @return Whether the collection contains the item/type of item.
-    */
-    bool PickupCollection::contains(BaseItem* item, bool anyOfType)
-    {
-        if (anyOfType)
-        {
-            return (this->items_.count(item->getPickupIdentifier()) > 0);
-        }
-        else
-        {
-            item_range bounds = this->items_.equal_range(item->getPickupIdentifier());
-            for (std::multimap<std::string, BaseItem*>::iterator it = bounds.first; it != bounds.second && it != this->items_.end(); it++)
-            {
-                if (it->second == item)
-                {
-                    return true;
-                }
-            }
-            return false;
-        }
-    }
-    //! Uses the first usable item in the collection on the owner.
-    void PickupCollection::useItem()
-    {
-        if(this->currentUsable_)
-            this->currentUsable_->used(this->owner_);
-    }
-    /**
-        @brief Uses a usable item on the owner of the collection.
-        @param item Item to use.
-    */
-    void PickupCollection::useItem(UsableItem* item)
-    {
-        if (item && this->owner_)
-            item->used(this->owner_);
-    }
-    /**
-        @brief Remove an item/all of a type from the collection.
-        @param item Item to remove.
-        @param removeAllOfType Whether to remove all the items with the item's type (default: false).
-    */
-    void PickupCollection::remove(BaseItem* item, bool removeAllOfType)
-    {
-        if (!item || !this->contains(item, removeAllOfType) || this->bBlockRemovals_)
-            return;
-
-        bool getNewUsable = false;
-        if (item == this->currentUsable_ || (this->currentUsable_ && removeAllOfType && this->currentUsable_->getPickupIdentifier() == item->getPickupIdentifier()))
-        {
-            getNewUsable = true;
-        }
-
-        if (removeAllOfType)
-        {
-            std::multimap<std::string, BaseItem*>::iterator it;
-            while ((it = this->items_.find(item->getPickupIdentifier())) != this->items_.end())
-            {
-                this->items_.erase(it);
-            }
-        }
-        else
-        {
-            item_range bounds = this->items_.equal_range(item->getPickupIdentifier());
-            for (std::multimap<std::string, BaseItem*>::iterator it = bounds.first; it != bounds.second && it != this->items_.end(); it++)
-            {
-                if (it->second == item)
-                {
-                    this->items_.erase(it);
-                    break;
-                }
-            }
-        }
-
-        if (getNewUsable)
-        {
-            std::deque<UsableItem*> usables = this->getUsableItems();
-
-            if(usables.size() > 0)
-                this->currentUsable_ = usables.at(0);
-            else
-                this->currentUsable_ = NULL;
-
-        }
-    }
-    /**
-        @brief Add an additive modifier.
-        @param type ModifierType to add.
-        @param value Value for the modifier.
-    */
-    void PickupCollection::addAdditiveModifier(ModifierType::Value type, float value)
-    {
-        this->additiveModifiers_.insert( std::pair<ModifierType::Value, float>(type, value) );
-    }
-    /**
-        @brief Get the total amount of an additive modifier.
-        @param type Type for which to get the total.
-        @return Returns the sum of the additive modifiers of the type.
-    */
-    float PickupCollection::getAdditiveModifier(ModifierType::Value type)
-    {
-        float v = 0.0f;
-
-        modifier_range range = this->additiveModifiers_.equal_range(type);
-
-        for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->additiveModifiers_.end(); it++)
-        {
-            v += it->second;
-        }
-
-        return v;
-    }
-    /**
-        @brief Remove an additive modifier.
-        @param type Type of modifier.
-        @param value Value which is to be removed.
-    */
-    void PickupCollection::removeAdditiveModifier(ModifierType::Value type, float value)
-    {
-        modifier_range range = this->additiveModifiers_.equal_range(type);
-        for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->additiveModifiers_.end(); it++)
-        {
-            if (it->second == value)
-            {
-                this->additiveModifiers_.erase(it);
-                return;
-            }
-        }
-    }
-    /**
-        @brief Add a multiplicative modifier.
-        @param type ModifierType to add.
-        @param value Value for the modifier.
-    */
-    void PickupCollection::addMultiplicativeModifier(ModifierType::Value type, float value)
-    {
-        this->multiplicativeModifiers_.insert( std::pair<ModifierType::Value, float>(type, value) );
-    }
-    /**
-        @brief Get the total amount of a multiplicative modifier.
-        @param type Type for which to get the total.
-        @return Returns the product of the multiplicative modifiers of the type.
-    */
-    float PickupCollection::getMultiplicativeModifier(ModifierType::Value type)
-    {
-        float v = 1.0f;
-
-        modifier_range range = this->multiplicativeModifiers_.equal_range(type);
-        for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->multiplicativeModifiers_.end(); it++)
-        {
-            v *= it->second;
-        }
-
-        return v;
-    }
-    /**
-        @brief Remove a multiplicative modifier.
-        @param type Type of modifier.
-        @param value Value which is to be removed.
-    */
-    void PickupCollection::removeMultiplicativeModifier(ModifierType::Value type, float value)
-    {
-        modifier_range range = this->multiplicativeModifiers_.equal_range(type);
-        for (std::multimap<ModifierType::Value, float>::iterator it = range.first; it != range.second && it != this->multiplicativeModifiers_.end(); it++)
-        {
-            if (it->second == value)
-            {
-                this->multiplicativeModifiers_.erase(it);
-                return;
-            }
-        }
-    }
-    /**
-        @brief Applies modifiers to a float.
-        @param type Type of modifier tp apply.
-        @param inputValue Value which is to be processed.
-        @param addBeforeMultiplication Whether to apply the additive modifier before the multiplicative one (default: false).
-        @return Returns the value after being processed.
-    */
-    float PickupCollection::processModifiers(ModifierType::Value type, float inputValue, bool addBeforeMultiplication)
-    {
-        float outputValue = inputValue;
-
-        if (addBeforeMultiplication)
-            outputValue += this->getAdditiveModifier(type);
-
-        outputValue *= this->getMultiplicativeModifier(type);
-
-        if (!addBeforeMultiplication)
-            outputValue += this->getAdditiveModifier(type);
-
-        return outputValue;
-    }
-    /**
-        @brief Applies modifiers to a Vector3.
-        @param type Type of modifier tp apply.
-        @param inputValue Value which is to be processed.
-        @param addBeforeMultiplication Whether to apply the additive modifier before the multiplicative one (default: false).
-        @return Returns the value after being processed.
-    */
-    Vector3 PickupCollection::processModifiers(ModifierType::Value type, Vector3 inputValue, bool addBeforeMultiplication)
-    {
-        Vector3 outputValue = inputValue;
-
-        if (addBeforeMultiplication)
-            outputValue += Vector3(this->getAdditiveModifier(type));
-
-        outputValue *= this->getMultiplicativeModifier(type);
-
-        if (!addBeforeMultiplication)
-            outputValue += Vector3(this->getAdditiveModifier(type));
-
-        return outputValue;
-    }
-    /**
-        @brief Get a list of equipment-type items.
-        @return Returns a list of all the equipment-type items in the collection.
-    */
-    std::deque<EquipmentItem*> PickupCollection::getEquipmentItems()
-    {
-        std::deque<EquipmentItem*> ret;
-        Identifier* ident = Class(EquipmentItem);
-
-        for (std::multimap<std::string, BaseItem*>::iterator it = this->items_.begin(); it != this->items_.end(); it++)
-        {
-            if (it->second->isA(ident))
-                ret.push_back(orxonox_cast<EquipmentItem*>(it->second));
-        }
-
-        return ret;
-    }
-    /**
-        @brief Get a list of passive items.
-        @return Returns a list of all the passive items in the collection.
-    */
-    std::deque<PassiveItem*> PickupCollection::getPassiveItems()
-    {
-        std::deque<PassiveItem*> ret;
-        Identifier* ident = Class(PassiveItem);
-
-        for (std::multimap<std::string, BaseItem*>::iterator it = this->items_.begin(); it != this->items_.end(); it++)
-        {
-            if (it->second->isA(ident))
-                ret.push_back(orxonox_cast<PassiveItem*>(it->second));
-        }
-
-        return ret;
-    }
-    /**
-        @brief Get a list of usable items.
-        @return Returns a list of all the usable items in the collection.
-    */
-    std::deque<UsableItem*> PickupCollection::getUsableItems()
-    {
-        std::deque<UsableItem*> ret;
-        Identifier* ident = Class(UsableItem);
-
-        for (std::multimap<std::string, BaseItem*>::iterator it = this->items_.begin(); it != this->items_.end(); it++)
-        {
-            if (it->second->isA(ident))
-                ret.push_back(orxonox_cast<UsableItem*>(it->second));
-        }
-
-        return ret;
-    }
-}

Deleted: code/branches/pickup3/src/orxonox/pickup/PickupCollection.h
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/PickupCollection.h	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/pickup/PickupCollection.h	2010-03-05 08:49:56 UTC (rev 6474)
@@ -1,101 +0,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 PickupCollection.
-*/
-
-#ifndef _PickupCollection_H__
-#define _PickupCollection_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include <deque>
-#include <map>
-#include <string>
-
-#include "util/Math.h"
-#include "ModifierType.h"
-
-namespace orxonox
-{
-    /**
-    @brief PickupCollection for organising items.
-    @author Daniel 'Huty' Haggenmueller
-    */
-    class _OrxonoxExport PickupCollection : public orxonox::OrxonoxClass
-    {
-        public:
-            PickupCollection();
-
-            bool add(BaseItem* item);       //!< Add an item to the collection.
-
-            bool checkSlot(BaseItem* item); //!< Check if there's a free slot in the collection for an item.
-
-            void clear();                   //!< Empty the collection
-            bool contains(BaseItem* item, bool anyOfType = false);                      //!< Check if the collection contains an item.
-
-            void remove(BaseItem* item, bool removeAllOfType = false);                  //!< Remove an item from the collection.
-
-            //TODO: Hmm... probably should stay...
-            void useItem();                                                             //!< Use the first usable item.
-            void useItem(UsableItem* item);                                             //!< Use a usable item.
-
-            /**
-                @brief Get the owner of the PickupCollection.
-                @return Returns the pawn which owns the PickupCollection.
-            */
-            inline Pawn* getOwner() const
-                { return this->owner_; }
-            /**
-                @brief Set the owner of the PickupCollection.
-                @param owner The new Pawn which owns the PickupCollection.
-            */
-            inline void setOwner(Pawn* owner)
-                { this->owner_ = owner; }
-
-            inline UsableItem* getCurrentUsable()
-                { return this->currentUsable_; };
-            inline void setCurrentUsable(UsableItem* usable)
-                { this->currentUsable_ = usable; }
-
-            std::deque<EquipmentItem*> getEquipmentItems();   //!< Get a list of equipment-type items.
-            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.
-            UsableItem* currentUsable_;
-            int slots_;
-
-            std::multimap<std::string, BaseItem*> items_;                       //!< Map of items in the collection (indexed by pickupIdentifier of the items).
-    };
-}
-
-#endif /* _PickupCollection_H__ */

Added: code/branches/pickup3/src/orxonox/pickup/PickupIdentifier.cc
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/PickupIdentifier.cc	                        (rev 0)
+++ code/branches/pickup3/src/orxonox/pickup/PickupIdentifier.cc	2010-03-05 08:49:56 UTC (rev 6474)
@@ -0,0 +1,99 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#include "PickupIdentifier.h"
+
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    
+    PickupIdentifier::PickupIdentifier()
+    {
+        RegisterRootObject(PickupIdentifier);
+        
+        
+    }
+    
+    PickupIdentifier::~PickupIdentifier()
+    {
+        
+    }
+    
+    /**
+    @brief
+        Compares two PickupIdentifiers and returns 0 if a == b, <0 if a < b and >0 if a > b for a.compare(b).
+    @param identifier
+        Pointer to the second PickupIdentifier, b.
+    @return
+        Returns an int.
+    */
+    int PickupIdentifier::compare(const PickupIdentifier& identifier) const
+    {
+        if(!identifier.classIdentifier_->isExactlyA(this->classIdentifier_))
+            return this->classIdentifier_->getName().compare(identifier.classIdentifier_->getName());
+        
+        if(!(this->parameters_.size() == identifier.parameters_.size()))
+        {
+            COUT(1) << "Something went wrong in PickupIdentifier!" << std::endl;
+            return this->parameters_.size()-identifier.parameters_.size();
+        }
+        
+        for(std::map<std::string, std::string>::const_iterator it = this->parameters_.begin(); it != this->parameters_.end(); it++)
+        {
+            if(identifier.parameters_.find(it->first) == identifier.parameters_.end())
+            {
+                COUT(1) << "Something went wrong in PickupIdentifier!" << std::endl;
+                return -1;
+            }
+            if(identifier.parameters_.find(it->first)->second != it->second)
+                return it->second.compare(identifier.parameters_.find(it->first)->second);
+        }
+            
+        return false;
+    }
+    
+    void PickupIdentifier::addClass(Identifier* identifier)
+    {
+        this->classIdentifier_ = identifier;
+    }
+    
+    bool PickupIdentifier::addParameter(std::string & name, std::string & value)
+    {
+        if(!(this->parameters_.find(name) == this->parameters_.end()))
+        {
+            COUT(2) << "Request for adding a parameter that already exists for the PickupIdentififer was denied." << std::endl;
+            return false;
+        }
+        
+        this->parameters_[name] = value;
+        
+        return true;
+    }
+    
+}

Added: code/branches/pickup3/src/orxonox/pickup/PickupIdentifier.h
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/PickupIdentifier.h	                        (rev 0)
+++ code/branches/pickup3/src/orxonox/pickup/PickupIdentifier.h	2010-03-05 08:49:56 UTC (rev 6474)
@@ -0,0 +1,76 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+#ifndef _PickupIdentifier_H__
+#define _PickupIdentifier_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "core/OrxonoxClass.h" 
+#include "core/Identifier.h"
+#include <map>
+#include <string>
+
+namespace orxonox
+{
+    
+    class _OrxonoxExport PickupIdentifier : virtual public OrxonoxClass
+    {
+        
+        public:
+            PickupIdentifier(void);
+            ~PickupIdentifier();
+            
+            virtual int compare(const PickupIdentifier& identifier) const;
+            
+            void addClass(Identifier* identifier);
+            bool addParameter(std::string & name, std::string & value);
+            
+        private:
+            Identifier* classIdentifier_;
+            std::map<std::string, std::string> parameters_;
+            
+            
+    };
+    
+    //TODO: Needed?
+    struct PickupIdentifierCompare
+    {
+        bool operator() (const PickupIdentifier& lhs, const PickupIdentifier& rhs) const
+            { return lhs.compare(rhs) < 0; }
+    };
+    
+    struct PickupIdentifierPtrCompare
+    {
+        bool operator() (const PickupIdentifier* lhs, const PickupIdentifier* rhs) const
+            { return lhs->compare(*rhs) < 0; }
+    };
+    
+}
+
+#endif // _PickupIdentifier_H__

Deleted: code/branches/pickup3/src/orxonox/pickup/PickupInventory.cc
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/PickupInventory.cc	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/pickup/PickupInventory.cc	2010-03-05 08:49:56 UTC (rev 6474)
@@ -1,387 +0,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 "PickupInventory.h"
-
-#include <CEGUIImage.h>
-#include <CEGUIImageset.h>
-#include <CEGUIImagesetManager.h>
-#include <CEGUIWindow.h>
-#include <CEGUIWindowManager.h>
-#include <elements/CEGUITabControl.h>
-
-#include "core/ConsoleCommand.h"
-#include "core/GUIManager.h"
-#include "core/input/InputManager.h"
-#include "controllers/HumanController.h"
-#include "worldentities/pawns/Pawn.h"
-
-#include "EquipmentItem.h"
-#include "PassiveItem.h"
-#include "UsableItem.h"
-
-
-namespace orxonox
-{
-    SetConsoleCommandShortcut(PickupInventory, toggleInventory);
-
-    PickupInventory* PickupInventory::pickupInventory_s = NULL;
-
-    //TODO: Comment.
-
-    /**
-    @brief
-        Get a Pointer to the PickupInventory Singleton.
-    @return
-        A Pointer to the PickupInventory.
-    */
-    //TODO: Make SingeltonPtr?
-    PickupInventory* PickupInventory::getSingleton()
-    {
-        if(!PickupInventory::pickupInventory_s)
-            PickupInventory::pickupInventory_s = new PickupInventory();
-
-        return PickupInventory::pickupInventory_s;
-    }
-
-    /**
-    @brief
-        Constructor. 
-    */
-    PickupInventory::PickupInventory()
-    {
-        //TODO: Maybe some abstraction for the usableWindows, e.g. push and pop...
-        //RegisterObject() ? In some other Class, too. Which?
-        this->bInventoryVisible_ = false; //TODO: If OrxonoxClass, this should already be there...
-        this->visibleEquipmentWindows_ = this->visibleUsableWindows_ = 0;
-
-        // Create some windows to avoid creating them while playing
-        CEGUI::WindowManager* winMgr = CEGUI::WindowManager::getSingletonPtr();
-        for(int i = 0; i < 10; i++)
-        {
-            std::ostringstream id;
-            id << i;
-
-            PickupInventory::createItemWindows(winMgr, "equ/" + id.str(), i % 5, i / 5);
-            PickupInventory::createItemWindows(winMgr, "use/" + id.str(), i % 5, i / 5);
-        }
-        this->createdEquipmentWindows_ = this->createdUsableWindows_ = 10;
-    }
-
-    /**
-    @brief
-        Destructor.
-    */
-    //TODO: Destroy something?
-    PickupInventory::~PickupInventory()
-    {
-    }
-
-    /**
-    @brief
-        Toggles the visibility of the inventory.
-    */
-    /*static*/ void PickupInventory::toggleInventory()
-    {
-        if(PickupInventory::getSingleton()->isVisible()) {
-            GUIManager::hideGUI("PickupInventory");
-        }
-        else
-        {
-            GUIManager::showGUI("PickupInventory");
-        }
-        PickupInventory::getSingleton()->setVisible(!PickupInventory::getSingleton()->isVisible());
-    }
-
-    /**
-    @brief
-        
-    */
-    unsigned int PickupInventory::getCurrentUsableIndex()
-    {
-        Pawn* pawn = HumanController::getLocalControllerEntityAsPawn();
-        if(pawn && pawn->getPickups().getCurrentUsable())
-        {
-            UsableItem* use = pawn->getPickups().getCurrentUsable();
-            std::deque<UsableItem*> items = pawn->getPickups().getUsableItems();
-            for(unsigned int i = 0; i < items.size(); i++)
-            {
-                if(items.at(i) == use)
-                    return i;
-            }
-        }
-
-        return 0;
-    }
-
-    bool PickupInventory::isCurrentUsable(const BaseItem* item)
-    {
-        Pawn* pawn = HumanController::getLocalControllerEntityAsPawn();
-        if(pawn)
-            return (pawn->getPickups().getCurrentUsable() == item);
-        else
-            return false;
-    }
-
-    void PickupInventory::selectUsable(unsigned int i)
-    {
-        Pawn* pawn = HumanController::getLocalControllerEntityAsPawn();
-        if(pawn)
-        {
-            std::deque<UsableItem*> items = pawn->getPickups().getUsableItems();
-            if(i < items.size())
-                pawn->getPickups().setCurrentUsable(items.at(i));
-        }
-    }
-
-    unsigned int PickupInventory::getEquipmentCount()
-    {
-        Pawn* pawn = HumanController::getLocalControllerEntityAsPawn();
-        if(pawn)
-            return pawn->getPickups().getEquipmentItems().size();
-        else
-            return 0;
-    }
-
-    unsigned int PickupInventory::getUsableCount()
-    {
-        Pawn* pawn = HumanController::getLocalControllerEntityAsPawn();
-        if(pawn)
-            return pawn->getPickups().getUsableItems().size();
-        else
-            return 0;
-    }
-
-    unsigned int PickupInventory::getPassiveCount()
-    {
-        Pawn* pawn = HumanController::getLocalControllerEntityAsPawn();
-        if(pawn)
-            return pawn->getPickups().getPassiveItems().size();
-        else
-            return 0;
-    }
-
-    BaseItem* PickupInventory::getEquipmentItem(unsigned int i)
-    {
-        Pawn* pawn = HumanController::getLocalControllerEntityAsPawn();
-        if(pawn)
-        {
-            std::deque<EquipmentItem*> l = pawn->getPickups().getEquipmentItems();
-            if (i >= l.size()) { return NULL; }
-            return l.at(i);
-        }
-        else
-            return NULL;
-    }
-
-    BaseItem* PickupInventory::getUsableItem(unsigned int i)
-    {
-        Pawn* pawn = HumanController::getLocalControllerEntityAsPawn();
-        if(pawn)
-        {
-            std::deque<UsableItem*> l = pawn->getPickups().getUsableItems();
-            if (i >= l.size()) { return NULL; }
-            return l.at(i);
-        }
-        else
-            return NULL;
-    }
-
-    BaseItem* PickupInventory::getPassiveItem(unsigned int i)
-    {
-        Pawn* pawn = HumanController::getLocalControllerEntityAsPawn();
-        if(pawn)
-        {
-            std::deque<PassiveItem*> l = pawn->getPickups().getPassiveItems();
-            if (i >= l.size()) { return NULL; }
-            return l.at(i);
-        }
-        else
-            return NULL;
-    }
-
-    std::string PickupInventory::getImageForItem(const BaseItem* item)
-    {
-        if(!item)
-            return "";
-
-        const std::string& name = "pickup_" + item->getGUIImage();
-
-        if(!CEGUI::ImagesetManager::getSingletonPtr()->isImagesetPresent(name))
-        {
-            CEGUI::ImagesetManager::getSingletonPtr()->createImagesetFromImageFile(name, item->getGUIImage(), "");
-        }
-
-        return ("set:" + name + " image:full_image");
-    }
-
-    void PickupInventory::clearInventory(CEGUI::WindowManager* winMgr, CEGUI::Window* equipPane, CEGUI::Window* usablePane)
-    {
-        for(unsigned int i = 0; i < this->visibleEquipmentWindows_; i++)
-        {
-            std::ostringstream id;
-            id << i;
-
-            winMgr->getWindow("orxonox/Inventory/Frame/equ/" + id.str())->setVisible(false);
-            winMgr->getWindow("orxonox/Inventory/Title/equ/" + id.str())->setVisible(false);
-            winMgr->getWindow("orxonox/Inventory/Items/equ/" + id.str())->setVisible(false);
-
-            /*equipPane->removeChildWindow("orxonox/Inventory/Frame/equ/" + id.str());
-            equipPane->removeChildWindow("orxonox/Inventory/Title/equ/" + id.str());
-            equipPane->removeChildWindow("orxonox/Inventory/Items/equ/" + id.str());*/
-        }
-        for(unsigned int i = 0; i < this->visibleUsableWindows_; i++)
-        {
-            std::ostringstream id;
-            id << i;
-
-            winMgr->getWindow("orxonox/Inventory/Frame/use/" + id.str())->setVisible(false);
-            winMgr->getWindow("orxonox/Inventory/Title/use/" + id.str())->setVisible(false);
-            winMgr->getWindow("orxonox/Inventory/Items/use/" + id.str())->setVisible(false);
-
-            /*usablePane->removeChildWindow("orxonox/Inventory/Frame/use/" + id.str());
-            usablePane->removeChildWindow("orxonox/Inventory/Title/use/" + id.str());
-            usablePane->removeChildWindow("orxonox/Inventory/Items/use/" + id.str());*/
-        }
-    }
-
-    void PickupInventory::updateTabs(CEGUI::WindowManager *winMgr, CEGUI::Window *equipWindow, CEGUI::Window *usableWindow)
-    {
-        this->updateEquipment(winMgr, equipWindow);
-        this->updateUsable(winMgr, usableWindow);
-    }
-
-    void PickupInventory::updateEquipment(CEGUI::WindowManager* winMgr, CEGUI::Window* target)
-    {
-        Pawn* pawn;
-        if((pawn = HumanController::getLocalControllerEntityAsPawn()))
-        {
-            std::deque<EquipmentItem*> items = pawn->getPickups().getEquipmentItems();
-            for(unsigned int i = 0; i < items.size(); i++)
-            {
-                std::ostringstream id;
-                id << "equ/" << i;
-
-                EquipmentItem* item = items.at(i);
-
-                if(this->createdEquipmentWindows_ <= i)
-                {
-                    PickupInventory::createItemWindows(winMgr, id.str(), i % 5, i / 5);
-                    this->createdEquipmentWindows_++;
-                }
-
-                PickupInventory::setWindowProperties(winMgr, target, id.str(), item, "FFFFFFFF");
-            }
-            this->visibleEquipmentWindows_ = items.size();
-        }
-    }
-
-    void PickupInventory::updateUsable(CEGUI::WindowManager* winMgr, CEGUI::Window* target)
-    {
-        Pawn* pawn;
-        if((pawn = HumanController::getLocalControllerEntityAsPawn()))
-        {
-            std::deque<UsableItem*> items = pawn->getPickups().getUsableItems();
-            for(unsigned int i = 0; i < items.size(); i++)
-            {
-                std::ostringstream id;
-                id << "use/" << i;
-
-                UsableItem* item = items.at(i);
-                std::string colour;
-
-                if(PickupInventory::isCurrentUsable(item))
-                    colour = "FFFF5555";
-                else
-                    colour = "FFFFFFFF";
-
-                if(this->createdUsableWindows_ <= i)
-                {
-                    PickupInventory::createItemWindows(winMgr, id.str(), i % 5, i / 5);
-                    this->createdUsableWindows_++;
-                }
-
-                PickupInventory::setWindowProperties(winMgr, target, id.str(), item, colour);
-            }
-            this->visibleUsableWindows_ = items.size();
-        }
-    }
-
-    void PickupInventory::createItemWindows(CEGUI::WindowManager* winMgr, const std::string& id, int x, int y)
-    {
-        if(!winMgr) { return; }
-
-        CEGUI::Window* frame = winMgr->createWindow("TaharezLook/StaticImage", "orxonox/Inventory/Frame/" + id);
-        frame->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 5 + x * 70), CEGUI::UDim(0, 5 + y * 90)));
-        frame->setSize(CEGUI::UVector2(CEGUI::UDim(0, 65), CEGUI::UDim(0, 65)));
-        frame->setRiseOnClickEnabled(false);
-        frame->setVisible(false);
-
-        CEGUI::Window* text = winMgr->createWindow("TaharezLook/StaticText", "orxonox/Inventory/Title/" + id);
-        text->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 5 + x * 70), CEGUI::UDim(0, 70 + y * 90)));
-        text->setSize(CEGUI::UVector2(CEGUI::UDim(0, 65), CEGUI::UDim(0, 20)));
-        text->setProperty("FrameEnabled", "False");
-        text->setProperty("BackgroundEnabled", "False");
-        text->setProperty("HorzFormatting", "HorzCentred");
-        text->setProperty("VertFormatting", "VertCentred");
-        text->setProperty("TextColours", "tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF");
-        text->setVisible(false);
-
-        CEGUI::Window* btn = winMgr->createWindow("TaharezLook/Button", "orxonox/Inventory/Items/" + id);
-        btn->setPosition(CEGUI::UVector2(CEGUI::UDim(0, 8 + x * 70), CEGUI::UDim(0, 8 + y * 90)));
-        btn->setSize(CEGUI::UVector2(CEGUI::UDim(0, 59), CEGUI::UDim(0, 59)));
-        btn->subscribeScriptedEvent("Clicked", "PickupInventory.itemClicked");
-        btn->setVisible(false);
-    }
-
-    void PickupInventory::setWindowProperties(CEGUI::WindowManager* winMgr, CEGUI::Window* target, const std::string& id, const BaseItem* item, const std::string& textColour)
-    {
-        CEGUI::Window* txt = winMgr->getWindow("orxonox/Inventory/Title/" + id);
-        CEGUI::Window* btn = winMgr->getWindow("orxonox/Inventory/Items/" + id);
-        CEGUI::Window* frm = winMgr->getWindow("orxonox/Inventory/Frame/" + id);
-
-        frm->setVisible(true);
-
-        txt->setVisible(true);
-        txt->setProperty("Text", item->getGUIText());
-        txt->setProperty("TextColours", "tl:" + textColour + " tr:" + textColour + " bl:" + textColour + " br:" + textColour);
-
-        const std::string& image = PickupInventory::getImageForItem(item);
-        btn->setVisible(true);
-        btn->setProperty("NormalImage", image);
-        btn->setProperty("HoverImage", image);
-        btn->setProperty("PushedImage", image);
-        btn->setProperty("DisabledImage", image);
-        btn->setProperty("Tooltip", item->getGUIText());
-
-        target->addChildWindow(frm);
-        target->addChildWindow(txt);
-        target->addChildWindow(btn);
-    }
-
-}

Deleted: code/branches/pickup3/src/orxonox/pickup/PickupInventory.h
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/PickupInventory.h	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/pickup/PickupInventory.h	2010-03-05 08:49:56 UTC (rev 6474)
@@ -1,100 +0,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 Declaration of static class for the inventory GUI window.
-*/
-
-#ifndef _PickupInventory_H__
-#define _PickupInventory_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include <CEGUIForwardRefs.h>
-#include "core/BaseObject.h"
-
-// tolua_begin
-namespace orxonox
-{
-    /**
-    @brief Static class for the inventory GUI window.
-    @author Daniel 'Huty' Haggenmueller
-    */
-    class _OrxonoxExport PickupInventory
-    {
-// tolua_end
-        public:
-            //TODO: Be derived from OrxonoxClass and ScopedSingleton.
-            //Make some methods private?
-            PickupInventory();
-            virtual ~PickupInventory();
-
-            static PickupInventory* getSingleton(); // tolua_export
-
-            static void toggleInventory(); // tolua_export
-
-            static unsigned int getEquipmentCount(); // tolua_export
-            static unsigned int getUsableCount(); // tolua_export
-            static unsigned int getPassiveCount(); // tolua_export
-
-            static unsigned int getCurrentUsableIndex(); // tolua_export
-            static bool isCurrentUsable(const BaseItem* item); // tolua_export
-            static void selectUsable(unsigned int i); // tolua_export
-
-            static BaseItem* getEquipmentItem(unsigned int i); // tolua_export
-            static BaseItem* getUsableItem(unsigned int i); // tolua_export
-            static BaseItem* getPassiveItem(unsigned int i); // tolua_export
-
-            static std::string getImageForItem(const BaseItem* item); // tolua_export
-
-            void clearInventory(CEGUI::WindowManager* winMgr, CEGUI::Window* equipPane, CEGUI::Window* usablePane); // tolua_export
-            void updateTabs(CEGUI::WindowManager* winMgr, CEGUI::Window* equipWindow, CEGUI::Window* usableWindow); // tolua_export
-
-            void updateEquipment(CEGUI::WindowManager* winMgr, CEGUI::Window* target);
-            void updateUsable(CEGUI::WindowManager* winMgr, CEGUI::Window* target);
-
-            static void createItemWindows(CEGUI::WindowManager* winMgr, const std::string& id, int x, int y);
-            static void setWindowProperties(CEGUI::WindowManager* winMgr, CEGUI::Window* target, const std::string& id, const BaseItem* item, const std::string& textColour);
-
-            const bool isVisible() const
-                { return this->bInventoryVisible_; }
-            void setVisible(bool visible)
-                { this->bInventoryVisible_ = visible; }
-        private:
-            bool bInventoryVisible_;
-            unsigned int createdEquipmentWindows_;
-            unsigned int createdUsableWindows_;
-            unsigned int visibleEquipmentWindows_;
-            unsigned int visibleUsableWindows_;
-
-            static PickupInventory* pickupInventory_s;
-    }; // tolua_export
-} // tolua_export
-
-#endif /* _PickupInventory_H__ */

Deleted: code/branches/pickup3/src/orxonox/pickup/PickupSpawner.cc
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/PickupSpawner.cc	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/pickup/PickupSpawner.cc	2010-03-05 08:49:56 UTC (rev 6474)
@@ -1,188 +0,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)
-    {
-        RegisterObject(PickupSpawner);
-
-        this->itemTemplate_ = 0;
-        this->triggerDistance_ = 20;
-        this->respawnTime_ = 0.0f;
-        this->tickSum_ = 0.0f;
-    }
-    //! Deconstructor.
-    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);
-
-        // 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::showGUI("PickupInventory");
-        GUIManager::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);
-    }
-    /**
-        @brief Tick, checks if any Pawn is close enough to trigger.
-        @param dt Time since last tick.
-    */
-    void PickupSpawner::tick(float dt)
-    {
-        if (this->isActive())
-        {
-            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);
-            }
-            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())
-        {
-            BaseObject* newObject = this->itemTemplate_->getBaseclassIdentifier()->fabricate(this);
-            BaseItem* asItem = orxonox_cast<BaseItem*>(newObject);
-            if (asItem)
-            {
-                asItem->setPickupIdentifier(this->itemTemplateName_);
-                asItem->addTemplate(this->itemTemplate_);
-
-                if (asItem->pickedUp(pawn))
-                {
-                    COUT(3) << this->itemTemplateName_ << " got picked up." << std::endl;
-
-                    if (this->respawnTime_ > 0.0f)
-                    {
-                        this->respawnTimer_.setTimer(this->respawnTime_, false, createExecutor(createFunctor(&PickupSpawner::respawnTimerCallback, this)));
-
-                        this->setActive(false);
-                        this->fireEvent();
-                    }
-                }
-                else
-                    newObject->destroy();
-            }
-        }
-    }
-    /**
-        @brief Invoked by the timer, re-activates the PickupSpawner.
-    */
-    void PickupSpawner::respawnTimerCallback()
-    {
-        COUT(3) << "PickupSpawner reactivated." << std::endl;
-
-        this->setActive(true);
-    }
-}

Deleted: code/branches/pickup3/src/orxonox/pickup/UsableItem.cc
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/UsableItem.cc	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/pickup/UsableItem.cc	2010-03-05 08:49:56 UTC (rev 6474)
@@ -1,47 +0,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 UsableItem.
-*/
-
-#include "UsableItem.h"
-#include "core/CoreIncludes.h"
-
-namespace orxonox
-{
-    /**
-    @brief Constructor. Registers the UsableItem.
-    @param creator Pointer to the object which created this item.
-    */
-    UsableItem::UsableItem(BaseObject* creator) : BaseItem(creator)
-    {
-        RegisterObject(UsableItem);
-    }
-}

Deleted: code/branches/pickup3/src/orxonox/pickup/UsableItem.h
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/UsableItem.h	2010-03-04 15:37:07 UTC (rev 6473)
+++ code/branches/pickup3/src/orxonox/pickup/UsableItem.h	2010-03-05 08:49:56 UTC (rev 6474)
@@ -1,61 +0,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 UsableItem.
-*/
-
-#ifndef _UsableItem_H__
-#define _UsableItem_H__
-
-#include "OrxonoxPrereqs.h"
-#include "BaseItem.h"
-
-namespace orxonox
-{
-    /**
-        @brief Base class for all usable items (not usable yet).
-        @author Daniel 'Huty' Haggenmueller
-    */
-    class _OrxonoxExport UsableItem : public BaseItem
-    {
-        //TODO: What is this exactly?
-        public:
-            UsableItem(BaseObject* creator);
-            virtual ~UsableItem() { }
-
-            /**
-                @brief Method invoked when the item is being used.
-                @param pawn Pawn which is using the item.
-            */
-            virtual void used(Pawn* pawn) { }
-    };
-}
-
-#endif /* _UsableItem_H__ */




More information about the Orxonox-commit mailing list