Index: code/branches/pickup3/src/modules/pickup/Pickup.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/Pickup.cc	(revision 6474)
+++ code/branches/pickup3/src/modules/pickup/Pickup.cc	(revision 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);
+        }
+    }
+    
+}
Index: code/branches/pickup3/src/modules/pickup/Pickup.h
===================================================================
--- code/branches/pickup3/src/modules/pickup/Pickup.h	(revision 6474)
+++ code/branches/pickup3/src/modules/pickup/Pickup.h	(revision 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__
Index: code/branches/pickup3/src/modules/pickup/PickupCollectionIdentifier.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupCollectionIdentifier.cc	(revision 6474)
+++ code/branches/pickup3/src/modules/pickup/PickupCollectionIdentifier.cc	(revision 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);
+    }
+    
+}
+
Index: code/branches/pickup3/src/modules/pickup/PickupCollectionIdentifier.h
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupCollectionIdentifier.h	(revision 6474)
+++ code/branches/pickup3/src/modules/pickup/PickupCollectionIdentifier.h	(revision 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_
Index: code/branches/pickup3/src/modules/pickup/PickupManager.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupManager.cc	(revision 6474)
+++ code/branches/pickup3/src/modules/pickup/PickupManager.cc	(revision 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;
+    }
+    
+}
Index: code/branches/pickup3/src/modules/pickup/PickupManager.h
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupManager.h	(revision 6474)
+++ code/branches/pickup3/src/modules/pickup/PickupManager.h	(revision 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__
Index: code/branches/pickup3/src/modules/pickup/PickupRepresentation.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupRepresentation.cc	(revision 6474)
+++ code/branches/pickup3/src/modules/pickup/PickupRepresentation.cc	(revision 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;
+    }
+    
+}
Index: code/branches/pickup3/src/modules/pickup/PickupRepresentation.h
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupRepresentation.h	(revision 6474)
+++ code/branches/pickup3/src/modules/pickup/PickupRepresentation.h	(revision 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__
Index: code/branches/pickup3/src/modules/pickup/PickupSpawner.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/PickupSpawner.cc	(revision 6466)
+++ code/branches/pickup3/src/modules/pickup/PickupSpawner.cc	(revision 6474)
@@ -66,9 +66,5 @@
         
         PickupRepresentation* representation = PickupManager::getInstance().getRepresentation(NULL);
-        
-        COUT(1) << "MUP4 " << representation << std::endl;
         this->attach(representation->getSpawnerRepresentation(this));
-        
-        COUT(1) << "MUP6" << std::endl;
     }
 
Index: code/branches/pickup3/src/modules/pickup/items/CMakeLists.txt
===================================================================
--- code/branches/pickup3/src/modules/pickup/items/CMakeLists.txt	(revision 6474)
+++ code/branches/pickup3/src/modules/pickup/items/CMakeLists.txt	(revision 6474)
@@ -0,0 +1,3 @@
+ADD_SOURCE_FILES(PICKUP_SRC_FILES
+  HealthPickup.cc
+)
Index: code/branches/pickup3/src/modules/pickup/items/HealthPickup.cc
===================================================================
--- code/branches/pickup3/src/modules/pickup/items/HealthPickup.cc	(revision 6474)
+++ code/branches/pickup3/src/modules/pickup/items/HealthPickup.cc	(revision 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.
+        }
+    }
+
+}
Index: code/branches/pickup3/src/modules/pickup/items/HealthPickup.h
===================================================================
--- code/branches/pickup3/src/modules/pickup/items/HealthPickup.h	(revision 6474)
+++ code/branches/pickup3/src/modules/pickup/items/HealthPickup.h	(revision 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__
