[Orxonox-commit 1821] r6538 - in code/trunk/src: modules/pickup modules/pickup/items orxonox/interfaces

dafrick at orxonox.net dafrick at orxonox.net
Tue Mar 16 18:15:45 CET 2010


Author: dafrick
Date: 2010-03-16 18:15:45 +0100 (Tue, 16 Mar 2010)
New Revision: 6538

Modified:
   code/trunk/src/modules/pickup/PickupCollection.cc
   code/trunk/src/modules/pickup/PickupCollection.h
   code/trunk/src/modules/pickup/PickupCollectionIdentifier.cc
   code/trunk/src/modules/pickup/PickupCollectionIdentifier.h
   code/trunk/src/modules/pickup/items/MetaPickup.cc
   code/trunk/src/modules/pickup/items/MetaPickup.h
   code/trunk/src/orxonox/interfaces/Pickupable.cc
   code/trunk/src/orxonox/interfaces/Pickupable.h
Log:
Done some (almost final) documenting in pickup module.


Modified: code/trunk/src/modules/pickup/PickupCollection.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupCollection.cc	2010-03-16 12:49:16 UTC (rev 6537)
+++ code/trunk/src/modules/pickup/PickupCollection.cc	2010-03-16 17:15:45 UTC (rev 6538)
@@ -27,20 +27,18 @@
  */
 
 /**
-    @file
+    @file PickupCollection.cc
     @brief Implementation of PickupCollection.
 */
 
-#include "PickupCollection.h"
-
 #include "core/CoreIncludes.h"
-#include "core/Template.h"
 #include "core/XMLPort.h"
 #include "interfaces/PickupCarrier.h"
 #include "DroppedPickup.h"
-
 #include "PickupCollectionIdentifier.h"
 
+#include "PickupCollection.h"
+
 namespace orxonox
 {
  
@@ -59,7 +57,7 @@
     
     /**
     @brief
-        Destructor.
+        Destructor. Iterates through all Pickupables this PickupCollection consists of and destroys them if they haven't been already.
     */
     PickupCollection::~PickupCollection()
     {
@@ -84,6 +82,10 @@
         this->initializeIdentifier();
     }
     
+    /**
+    @brief
+        Initializes the PickupIdentifier for this pickup.
+    */
     void PickupCollection::initializeIdentifier(void)
     {
         for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
@@ -94,51 +96,9 @@
     
     /**
     @brief
-        Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
-        This method must be implemented by any class directly inheriting from Pickupable. It is most easily done by just creating a new DroppedPickup, e.g.:
-        DroppedPickup(BaseObject* creator, Pickupable* pickup, const Vector3& position);
-    @param position
-        The position at which the PickupSpawner should be placed.
-    @return
-        Returns true if a spawner was created, false if not.
+        Is 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.
     */
-    bool PickupCollection::createSpawner(const Vector3& position)
-    {
-        new DroppedPickup(this, this, position);
-        return true;
-    }
-    
-    /**
-    @brief
-        Add the input Pickupable to list of Pickupables combined by this PickupCollection.
-    @param pickup
-        The Pickupable to be added.
-    @return
-        Returns true if successful,
-    */
-    bool PickupCollection::addPickupable(Pickupable* pickup)
-    {
-        if(pickup == NULL)
-            return false;
-        
-        WeakPtr<Pickupable> ptr = pickup;
-        this->pickups_.push_back(ptr);
-        return true;
-    }
-    
-    /**
-    @brief
-        Get the Pickupable at the given index.
-    @param index
-        The index the Pickupable is fetched from.
-    @return
-        Returns a pointer to the Pickupable at the index given by index.
-    */
-    const Pickupable* PickupCollection::getPickupable(unsigned int index)
-    {
-        return this->pickups_[index].get(); //TODO. Does this work?
-    }
-    
     void PickupCollection::changedUsed(void)
     {
         SUPER(PickupCollection, changedUsed);
@@ -150,28 +110,45 @@
         }
     }
     
+    /**
+    @brief
+        Is called when the pickup has changed its PickupCarrier.
+        Any Class overwriting this method must call its SUPER function by adding SUPER(Classname, changedCarrier); to their changedCarrier method.
+    */
     void PickupCollection::changedCarrier(void)
     {
         SUPER(PickupCollection, changedCarrier);
         
-        //! Change used for all Pickupables this PickupCollection consists of.
+        //! Change the PickupCarrier for all Pickupables this PickupCollection consists of.
         for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
         {
             (*it).get()->setCarrier(this->getCarrier());
         }
     }
     
+    /**
+    @brief
+        Is 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, changedPickedUp); to their changedPickedUp method.
+    */
     void PickupCollection::changedPickedUp()
     {
         SUPER(PickupCollection, changedPickedUp);
         
-        //! Change the carrier for all Pickupables this PickupCollection consists of.
+        //! Change the pickedUp status for all Pickupables this PickupCollection consists of.
         for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
         {
             (*it).get()->setPickedUp(this->isPickedUp());
         }
     }
     
+    /**
+    @brief
+        Creates a duplicate of the input OrxonoxClass.
+        This method needs to be implemented by any Class inheriting from Pickupable.
+    @param item
+        A reference to a pointer to the OrxonoxClass that is to be duplicated.
+    */
     void PickupCollection::clone(OrxonoxClass*& item)
     {
         if(item == NULL)
@@ -180,6 +157,7 @@
         SUPER(PickupCollection, clone, item);
         
         PickupCollection* pickup = dynamic_cast<PickupCollection*>(item);
+        //! Clone allPickupables this PickupCollection consist of.
         for(std::vector<WeakPtr<Pickupable> >::iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
         {
             Pickupable* newPickup = (*it).get()->clone();
@@ -189,6 +167,14 @@
         pickup->initializeIdentifier();
     }
     
+    /**
+    @brief
+        Get whether a given class, represented by the input Identifier, is a target of this PickupCollection.
+    @param identifier
+        A pointer to the PickupIdentifier of the PickupCarrier we want to know of, whether it is a target of this PickupCollection.
+    @return
+        Returns true if the PickupCarrier identified by the input PickupIdentififer it is a target of this PickupCollection, false if not.
+    */
     bool PickupCollection::isTarget(Identifier* identifier) const
     {
         for(std::vector<WeakPtr<Pickupable> >::const_iterator it = this->pickups_.begin(); it != this->pickups_.end(); it++)
@@ -200,9 +186,63 @@
         return true;
     }
     
+    /**
+    @brief
+        Get the PickupIdentifier of this PickupCollection.
+        This is in fact the PickupCollectionIdentifier.
+    @return
+        Returns a pointer to the PickupIdentifier of this PickupCollection.
+    */
     const PickupIdentifier* PickupCollection::getPickupIdentifier(void)
     {
         return this->pickupCollectionIdentifier_;
     }
     
+    /**
+    @brief
+        Add the input Pickupable to list of Pickupables combined by this PickupCollection.
+    @param pickup
+        The Pickupable to be added.
+    @return
+        Returns true if successful,
+    */
+    bool PickupCollection::addPickupable(Pickupable* pickup)
+    {
+        if(pickup == NULL)
+            return false;
+        
+        WeakPtr<Pickupable> ptr = pickup; //!< Create a weak pointer to be able to test in the constructor if the Pointer is still valid.
+        this->pickups_.push_back(ptr);
+        return true;
+    }
+    
+    /**
+    @brief
+        Get the Pickupable at the given index.
+    @param index
+        The index the Pickupable is fetched from.
+    @return
+        Returns a pointer to the Pickupable at the index given by index.
+    */
+    const Pickupable* PickupCollection::getPickupable(unsigned int index)
+    {
+        return this->pickups_[index].get();
+    }
+        
+    /**
+    @brief
+        Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
+        This method must be implemented by any class directly inheriting from Pickupable. It is most easily done by just creating a new DroppedPickup, e.g.:
+        DroppedPickup(BaseObject* creator, Pickupable* pickup, const Vector3& position);
+    @param position
+        The position at which the PickupSpawner should be placed.
+    @return
+        Returns true if a spawner was created, false if not.
+    */
+    bool PickupCollection::createSpawner(const Vector3& position)
+    {
+        new DroppedPickup(this, this, position);
+        return true;
+    }
+    
 }
\ No newline at end of file

Modified: code/trunk/src/modules/pickup/PickupCollection.h
===================================================================
--- code/trunk/src/modules/pickup/PickupCollection.h	2010-03-16 12:49:16 UTC (rev 6537)
+++ code/trunk/src/modules/pickup/PickupCollection.h	2010-03-16 17:15:45 UTC (rev 6538)
@@ -26,6 +26,11 @@
  *
  */
 
+/**
+    @file PickupCollection.h
+    @brief Declaration of PickupCollection.
+*/
+
 #ifndef _PickupCollection_H__
 #define _PickupCollection_H__
 
@@ -33,7 +38,6 @@
 
 #include "interfaces/Pickupable.h"
 #include "core/BaseObject.h"
-#include "core/XMLPort.h"
 
 #include <list>
 
@@ -51,34 +55,34 @@
         
         public:
             
-            PickupCollection(BaseObject* creator);
-            virtual ~PickupCollection();
+            PickupCollection(BaseObject* creator); //!< Default Constructor.
+            virtual ~PickupCollection(); //!< Destructor.
             
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Creates an instance of this Class through XML.
 
-            virtual void changedUsed(void);
-            virtual void changedCarrier(void);
-            virtual void changedPickedUp(void);
+            virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
+            virtual void changedCarrier(void); //!< Is called when the pickup has changed its PickupCarrier.
+            virtual void changedPickedUp(void); //!< Is called when the pickup has transited from picked up to dropped or the other way around.
             
-            virtual void clone(OrxonoxClass*& item);
+            virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
             
-            virtual bool isTarget(Identifier* identifier) const;
+            virtual bool isTarget(Identifier* identifier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this PickupCollection.
             
-            virtual const PickupIdentifier* getPickupIdentifier(void);
+            virtual const PickupIdentifier* getPickupIdentifier(void); //!< Get the PickupIdentifier of this PickupCollection.
             
-            bool addPickupable(Pickupable* pickup);
-            const Pickupable* getPickupable(unsigned int index);
+            bool addPickupable(Pickupable* pickup); //!< Add the input Pickupable to list of Pickupables combined by this PickupCollection.
+            const Pickupable* getPickupable(unsigned int index); //!< Get the Pickupable at the given index.
             
         protected:
-            void initializeIdentifier(void);
+            void initializeIdentifier(void); //!< Initializes the PickupIdentifier for this pickup.
             
             virtual bool createSpawner(const Vector3& position); //!< Facilitates the creation of a PickupSpawner upon dropping of the Pickupable.
             
-            PickupCollectionIdentifier* pickupCollectionIdentifier_;
+            PickupCollectionIdentifier* pickupCollectionIdentifier_; //!< The PickupCollectionIdentifier of this PickupCollection. Is used to distinguish different PickupCollections amongst themselves.
             
         private:
             
-            std::vector<WeakPtr<Pickupable> > pickups_;
+            std::vector<WeakPtr<Pickupable> > pickups_; //!< The list of the pointers of all the Pickupables this PickupCollection consists of. They are weak pointers to facilitate testing, whether the pointers are still valid.
         
     };
     

Modified: code/trunk/src/modules/pickup/PickupCollectionIdentifier.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupCollectionIdentifier.cc	2010-03-16 12:49:16 UTC (rev 6537)
+++ code/trunk/src/modules/pickup/PickupCollectionIdentifier.cc	2010-03-16 17:15:45 UTC (rev 6538)
@@ -20,41 +20,67 @@
  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
  *   Author:
- *      ...
+ *      Damian 'Mozork' Frick
  *   Co-authors:
  *      ...
  *
 */
 
-#include "PickupCollectionIdentifier.h"
+/**
+    @file PickupCollectionIdentifier.cc
+    @brief Implementation of PickupCollectionIdentifier.
+*/
 
 #include "core/CoreIncludes.h"
 
+#include "PickupCollectionIdentifier.h"
+
 namespace orxonox
 {
     
+    /**
+    @brief
+        Constructor. Registers the object.
+    */
     PickupCollectionIdentifier::PickupCollectionIdentifier(Pickupable* pickup) : PickupIdentifier(pickup)
     {
         RegisterObject(PickupCollectionIdentifier);
     }
     
+    /**
+    @brief
+        Destructor.
+    */
     PickupCollectionIdentifier::~PickupCollectionIdentifier()
     {
         
     }
 
+    /**
+    @brief
+        Compares a PickupCollectionIdentifier with a PickupIdentifier and returns 0 if a == b, <0 if a < b and >0 if a > b for a.compare(b), where a is a PickupCollectionIdentifier and b is just some PickupIdentifier.
+    @param identifier
+        Pointer to the second PickupIdentifier, b.
+    @return
+        Returns an integer. 0 if the two compared PickupIdentifiers are the same, <0 if a < b and >0 if a > b.
+    */
     int PickupCollectionIdentifier::compare(const PickupIdentifier* identifier) const
     {
+        //! Slight un-niceity to cast the PickupIdentifier to a PickupCollectionIdentifier.
         PickupIdentifier* temp = const_cast<PickupIdentifier*>(identifier);
         const PickupCollectionIdentifier* collectionIdentifier = dynamic_cast<PickupCollectionIdentifier*>(temp);
+        
+        //! If the input PickupIdentifier 'identifier' is no PickupCollectionIdentifier then just the two PickupIdentifiers are compared.
         if(collectionIdentifier == NULL)
         {
             return this->PickupIdentifier::compare(identifier);
         }
         
+        //! If the number of Pickupables each of the two PickupCollectionIdentifiers contain differ, the one with less is considered smaller.
         if(this->identifiers_.size() != collectionIdentifier->identifiers_.size())
             return this->identifiers_.size()-collectionIdentifier->identifiers_.size();
         
+        //! Compare the Pickupables of the two PickupCollectionIdentifiers one after the other. the one with the first 'smaller' one is considered smaller.
         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++)
         {
@@ -65,9 +91,16 @@
                 return 1;
         }
         
+        //! Means they are equal.
         return 0;
     }
     
+    /**
+    @brief
+        Add a Pickupable to the PickupCollectionIdentifier.
+    @param
+        A pointer to the PickupIdentifier of the Pickupable to be added.
+    */
     void PickupCollectionIdentifier::addPickup(const PickupIdentifier* identifier)
     {
         this->identifiers_.insert(identifier);

Modified: code/trunk/src/modules/pickup/PickupCollectionIdentifier.h
===================================================================
--- code/trunk/src/modules/pickup/PickupCollectionIdentifier.h	2010-03-16 12:49:16 UTC (rev 6537)
+++ code/trunk/src/modules/pickup/PickupCollectionIdentifier.h	2010-03-16 17:15:45 UTC (rev 6538)
@@ -20,36 +20,50 @@
  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
  *   Author:
- *      ...
+ *      Damian 'Mozork' Frick
  *   Co-authors:
  *      ...
  *
 */
 
+/**
+    @file PickupCollectionIdentifier.h
+    @brief Declaration of PickupCollectionIdentifier.
+*/
+
 #ifndef _PickupCollectionIdentifier_H__
 #define _PickupCollectionIdentifier_H_
 
 #include "PickupPrereqs.h"
 
 #include "pickup/PickupIdentifier.h"
+
 #include <set>
 
 namespace orxonox
 {
 
+    /**
+    @brief
+        The PickupCollectionIdentifier is the specialization of the PickupIdentifier for the PickupCollection class.
+        It identifies PickupCollections based on the different Pickupables they consist of.
+        Pickupables can be added to the PickupCollectionIdentifier via the addPickup method.
+    @author
+        Damian 'Mozork' Frick
+    */
     class _PickupExport PickupCollectionIdentifier : public PickupIdentifier
     {
         
         public:
-            PickupCollectionIdentifier(Pickupable* pickup);
-            ~PickupCollectionIdentifier();
+            PickupCollectionIdentifier(Pickupable* pickup); //!< Constructor.
+            ~PickupCollectionIdentifier(); //!< Destructor.
             
-            virtual int compare(const PickupIdentifier* identifier) const;
+            virtual int compare(const PickupIdentifier* identifier) const; //!< Compares a PickupCollectionIdentifier with a PickupIdentifier.
             
-            void addPickup(const PickupIdentifier* identifier);
+            void addPickup(const PickupIdentifier* identifier); //!< Add a Pickupable to the PickupCollectionIdentifier.
             
         private:
-            std::set<const PickupIdentifier*, PickupIdentifierCompare> identifiers_;
+            std::set<const PickupIdentifier*, PickupIdentifierCompare> identifiers_; //!< The set of PickupIdentifiers of the Pickupables the PickupCollection with this PickupCollectionIdentifier consists of, ordered by the rule set by PickupIdentifierCompare.
             
     };
     

Modified: code/trunk/src/modules/pickup/items/MetaPickup.cc
===================================================================
--- code/trunk/src/modules/pickup/items/MetaPickup.cc	2010-03-16 12:49:16 UTC (rev 6537)
+++ code/trunk/src/modules/pickup/items/MetaPickup.cc	2010-03-16 17:15:45 UTC (rev 6538)
@@ -27,7 +27,7 @@
 */
 
 /**
-    @file
+    @file MetaPickup.cc
     @brief Implementation of the MetaPickup class.
 */
 
@@ -42,29 +42,48 @@
  
     CreateFactory(MetaPickup);
     
+    //! Setting the static variables to their values.
     /*static*/ const std::string MetaPickup::metaTypeNone_s = "none";
     /*static*/ const std::string MetaPickup::metaTypeUse_s = "use";
     /*static*/ const std::string MetaPickup::metaTypeDrop_s = "drop";
     
     /**
     @brief
-        Constructor. 
+        Constructor. Registers and initializes the object.
     */
     MetaPickup::MetaPickup(BaseObject* creator) : Pickup(creator)
     {
         RegisterObject(MetaPickup);
         
-        this->addTarget(ClassIdentifier<PickupCarrier>::getIdentifier());
-        this->setActivationTypeDirect(pickupActivationType::immediate);
-        this->setDurationTypeDirect(pickupDurationType::once);
-        this->metaType_ = pickupMetaType::none;
+        this->initialize();
     }
     
+    /**
+    @brief
+        Destructor.
+    */
     MetaPickup::~MetaPickup()
     {
         
     }
     
+    /**
+    @brief
+        Initializes the object.
+    */
+    void MetaPickup::initialize(void)
+    {
+        this->addTarget(ClassIdentifier<PickupCarrier>::getIdentifier());
+        
+        this->setActivationTypeDirect(pickupActivationType::immediate);
+        this->setDurationTypeDirect(pickupDurationType::once);
+        this->metaType_ = pickupMetaType::none;
+    }
+    
+    /**
+    @brief
+        Helper method to initialize the PickupIdentifier.
+    */
     void MetaPickup::initializeIdentifier(void)
     {
         std::string val = this->getMetaType();
@@ -72,6 +91,10 @@
         this->pickupIdentifier_->addParameter(type, val);
     }
     
+    /**
+    @brief
+        Method for creating a MetaPickup object through XML.
+    */
     void MetaPickup::XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode)
     {
         SUPER(MetaPickup, XMLPort, xmlelement, mode);
@@ -81,16 +104,23 @@
         this->initializeIdentifier();
     }
     
+    /**
+    @brief
+        Is 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.
+    */
     void MetaPickup::changedUsed(void)
     {
         SUPER(MetaPickup, changedUsed);
         
+        //! If the MetaPickup transited to used.
         if(this->isUsed())
         {
             PickupCarrier* carrier = this->getCarrier();
             if(this->getMetaTypeDirect() != pickupMetaType::none && carrier != NULL)
             {
                 std::set<Pickupable*> pickups = carrier->getPickups();
+                //! Set all Pickupables carried by the PickupCarrier either to used or drop them, depending o the meta type.
                 for(std::set<Pickupable*>::iterator it = pickups.begin(); it != pickups.end(); it++)
                 {
                     Pickup* pickup = dynamic_cast<Pickup*>(*it);
@@ -113,7 +143,32 @@
             this->destroy();
         }
     }
+        
+    /**
+    @brief
+        Creates a duplicate of the input OrxonoxClass.
+    @param item
+        A pointer to the Orxonox class.
+    */
+    void MetaPickup::clone(OrxonoxClass*& item)
+    {
+        if(item == NULL)
+            item = new MetaPickup(this);
+        
+        SUPER(MetaPickup, clone, item);
+        
+        MetaPickup* pickup = dynamic_cast<MetaPickup*>(item);
+        pickup->setMetaTypeDirect(this->getMetaTypeDirect());
+        
+        pickup->initializeIdentifier();
+    }
     
+    /**
+    @brief
+        Get the meta type of this MetaPickup.
+    @return
+        Returns a string with the meta type of the MetaPickup.
+    */
     const std::string& MetaPickup::getMetaType(void)
     {
         switch(this->getMetaTypeDirect())
@@ -129,6 +184,12 @@
         }
     }
     
+    /**
+    @brief
+        Set the meta type of this MetaPickup.
+    @param type
+        A string with the type to be set.
+    */
     void MetaPickup::setMetaType(const std::string& type)
     {
         if(type == MetaPickup::metaTypeNone_s)
@@ -145,17 +206,4 @@
         }
     }
     
-    void MetaPickup::clone(OrxonoxClass*& item)
-    {
-        if(item == NULL)
-            item = new MetaPickup(this);
-        
-        SUPER(MetaPickup, clone, item);
-        
-        MetaPickup* pickup = dynamic_cast<MetaPickup*>(item);
-        pickup->setMetaTypeDirect(this->getMetaTypeDirect());
-        
-        pickup->initializeIdentifier();
-    }
-    
 }

Modified: code/trunk/src/modules/pickup/items/MetaPickup.h
===================================================================
--- code/trunk/src/modules/pickup/items/MetaPickup.h	2010-03-16 12:49:16 UTC (rev 6537)
+++ code/trunk/src/modules/pickup/items/MetaPickup.h	2010-03-16 17:15:45 UTC (rev 6538)
@@ -27,7 +27,7 @@
 */
 
 /**
-    @file
+    @file MetaPickup.h
     @brief Definition of the MetaPickup class.
 */
 
@@ -61,29 +61,40 @@
     {
         
         public:
-            MetaPickup(BaseObject* creator);
-            virtual ~MetaPickup();
+            MetaPickup(BaseObject* creator); //!< Constructor. Registers and initializes the object.
+            virtual ~MetaPickup(); //!< Destructor.
             
-            virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a HealthPickup object through XML.
+            virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a MetaPickup object through XML.
             
             virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
             virtual void clone(OrxonoxClass*& item); //!< Creates a duplicate of the input OrxonoxClass.
             
+            /**
+            @brief Returns the meta type of the MetaPickup.
+            @return Returns an enum with the meta type of the MetaPickup.
+            */
             inline pickupMetaType::Value getMetaTypeDirect(void)
                 { return this->metaType_; }
-            const std::string& getMetaType(void);
+            const std::string& getMetaType(void); //!< Get the meta type of this MetaPickup.
             
         protected:
+            void initialize(void); //!< Initializes the object.
             void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
             
+            /**
+            @brief Set the meta type of the MetaPickup.
+            @param type The meta type as an enum.
+            */
             inline void setMetaTypeDirect(pickupMetaType::Value type)
                 { this->metaType_ =  type; }
-            void setMetaType(const std::string& type);
+            void setMetaType(const std::string& type); //!< Set the meta type of this MetaPickup.
             
         private:
             void initialize(void); //!< Initializes the member variables.
             
-            pickupMetaType::Value metaType_;
+            pickupMetaType::Value metaType_; //!< The meta type of the MetaPickup, determines which actions are taken.
+            
+            //! Static strings for the meta types.
             static const std::string metaTypeNone_s;
             static const std::string metaTypeUse_s;
             static const std::string metaTypeDrop_s;

Modified: code/trunk/src/orxonox/interfaces/Pickupable.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/Pickupable.cc	2010-03-16 12:49:16 UTC (rev 6537)
+++ code/trunk/src/orxonox/interfaces/Pickupable.cc	2010-03-16 17:15:45 UTC (rev 6538)
@@ -27,7 +27,7 @@
  */
 
 /**
-    @file
+    @file Pickupable.cc
     @brief Implementation of the Pickupable class.
 */
 
@@ -95,9 +95,9 @@
     
     /**
     @brief
-        Get whether the given PickupCarrier is a target of this pickup.
+        Get whether the given PickupCarrier is a target of this Pickupable.
     @param carrier
-        The PickupCarrier of which it has to be determinde whether it is a target of this pickup.
+        The PickupCarrier of which it has to be determinde whether it is a target of this Pickupable.
     @return
         Returns true if the given PickupCarrier is a target.
     */
@@ -108,9 +108,9 @@
     
     /**
     @brief
-        Get whether a given class, represented by the input Identifier, is a target of this pickup.
+        Get whether a given class, represented by the input Identifier, is a target of this Pickupable.
     @param target
-        The Identifier of which it has to be determinde whether it is a target of this pickup.
+        The Identifier of which it has to be determinde whether it is a target of this Pickupable.
     @return
         Returns true if the given Identifier is a target.
     */
@@ -127,7 +127,7 @@
         
     /**
     @brief
-        Add a PickupCarrier as target of this pickup.
+        Add a PickupCarrier as target of this Pickupable.
     @param target
         The PickupCarrier to be added.
     @return
@@ -140,7 +140,7 @@
     
     /**
     @brief
-        Add a class, representetd by the input Identifier, as target of this pickup.
+        Add a class, representetd by the input Identifier, as target of this Pickupable.
     @param target
         The Identifier to be added.
     @return
@@ -198,7 +198,7 @@
         
     /**
     @brief
-        Sets the carrier of the pickup.
+        Sets the carrier of the Pickupable.
     @param carrier
         Sets the input PickupCarrier as the carrier of the pickup.
     */
@@ -264,7 +264,7 @@
         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.
+        A reference to 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)

Modified: code/trunk/src/orxonox/interfaces/Pickupable.h
===================================================================
--- code/trunk/src/orxonox/interfaces/Pickupable.h	2010-03-16 12:49:16 UTC (rev 6537)
+++ code/trunk/src/orxonox/interfaces/Pickupable.h	2010-03-16 17:15:45 UTC (rev 6538)
@@ -27,7 +27,7 @@
  */
 
 /**
-    @file
+    @file Pickupable.h
     @brief Definition of the Pickupable class.
 */
 
@@ -99,7 +99,7 @@
             bool dropped(void); //!< Sets the Pickupable to not picked up or dropped.
             
             bool isTarget(const PickupCarrier* carrier) const; //!< Get whether the given PickupCarrier is a target of this pickup.
-            virtual bool isTarget(Identifier* identifier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this pickup.
+            virtual bool isTarget(Identifier* identifier) const; //!< Get whether a given class, represented by the input Identifier, is a target of this Pickupable.
             bool addTarget(PickupCarrier* target); //!< Add a PickupCarrier as target of this pickup.
             bool addTarget(Identifier* identifier); //!< Add a class, representetd by the input Identifier, as target of this pickup.
             
@@ -122,7 +122,6 @@
             /**
             @brief Helper method to initialize the PickupIdentifier.
             */
-            //TODO: Really needed?
             void initializeIdentifier(void) {}
             
             /**




More information about the Orxonox-commit mailing list