Index: code/branches/pickup3/src/orxonox/pickup/PickupIdentifier.cc
===================================================================
--- code/branches/pickup3/src/orxonox/pickup/PickupIdentifier.cc	(revision 6474)
+++ code/branches/pickup3/src/orxonox/pickup/PickupIdentifier.cc	(revision 6475)
@@ -34,9 +34,13 @@
 {
     
+    /**
+    @brief
+        Constructor. Registers the object and initializes member variables.
+    */
     PickupIdentifier::PickupIdentifier()
     {
         RegisterRootObject(PickupIdentifier);
         
-        
+        this->classIdentifier_ = NULL;
     }
     
@@ -52,26 +56,31 @@
         Pointer to the second PickupIdentifier, b.
     @return
-        Returns an int.
+        Returns an integer. 0 if the two compared PickupIdentifiers are the same, <0 if a < b and >0 if a > b.
     */
-    int PickupIdentifier::compare(const PickupIdentifier& identifier) const
+    int PickupIdentifier::compare(const PickupIdentifier* identifier) const
     {
-        if(!identifier.classIdentifier_->isExactlyA(this->classIdentifier_))
-            return this->classIdentifier_->getName().compare(identifier.classIdentifier_->getName());
+        //! If the classIdentifiers are not the same (meaning the PickupIdentifiers identify different classes), the obviously the two Pickupables identified by the PickupIdentifiers cannot be the same. An ordering is established through the alphabetical ordering of the respective classnames.
+        if(!identifier->classIdentifier_->isExactlyA(this->classIdentifier_))
+            return this->classIdentifier_->getName().compare(identifier->classIdentifier_->getName());
         
-        if(!(this->parameters_.size() == identifier.parameters_.size()))
+        //! If the class is the same for both PickupIdentifiers we go on to check the parameters of the class.
+        //! If the two have a different number of parameters then obviusly something is very wrong.
+        if(!(this->parameters_.size() == identifier->parameters_.size()))
         {
             COUT(1) << "Something went wrong in PickupIdentifier!" << std::endl;
-            return this->parameters_.size()-identifier.parameters_.size();
+            return this->parameters_.size()-identifier->parameters_.size();
         }
         
+        //! We iterate through all parameters and compar their values (which are strings). The first parameter is the most significant. The ordering is once again established by the alphabetical comparison of the two value strings.
         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())
+            //!< If a parameter present in one of the identifiers is not found in the other, once again, something is very wrong.
+            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);
+            if(identifier->parameters_.find(it->first)->second != it->second)
+                return it->second.compare(identifier->parameters_.find(it->first)->second);
         }
             
@@ -79,4 +88,10 @@
     }
     
+    /**
+    @brief
+        Add the class of the Pickupable to its PickupIdentifier.
+    @param identifier
+        A pointer to the Identifier of the class.
+    */
     void PickupIdentifier::addClass(Identifier* identifier)
     {
@@ -84,4 +99,14 @@
     }
     
+    /**
+    @brief
+        Add a parameter to the PickupIdentifier.
+    @param name
+        The name of the parameter.
+    @param value
+        The value of the parameter.
+    @return
+        Returns false if the parameter already existed, true if not.
+    */
     bool PickupIdentifier::addParameter(std::string & name, std::string & value)
     {
