Index: code/branches/questsystem2/src/orxonox/objects/quest/AddQuest.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/AddQuest.h	(revision 2220)
+++ code/branches/questsystem2/src/orxonox/objects/quest/AddQuest.h	(revision 2221)
@@ -48,4 +48,8 @@
     @brief
         Adds a Quest, resp. changes the quests status to active for the player invoking the Quest.
+        
+        Creating a AddQuest through XML goes as follows:
+        
+        <AddQuest questId="id" />  //Where id is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information, and identifies the Quest that should be added.
     @author
         Damian 'Mozork' Frick
Index: code/branches/questsystem2/src/orxonox/objects/quest/AddQuestHint.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/AddQuestHint.h	(revision 2220)
+++ code/branches/questsystem2/src/orxonox/objects/quest/AddQuestHint.h	(revision 2221)
@@ -47,4 +47,8 @@
     @brief
         Adds a QuestHint, resp. activates the QuestHint of the given id for the player the QuestEffect is invoked on.
+        
+	Creating a AddQuestHint through XML goes as follows:
+        
+        <AddQuestHint hintId="id" />  //Where id is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information, and identifies the QuestHint that should be added.
     @author
         Damian 'Mozork' Frick
Index: code/branches/questsystem2/src/orxonox/objects/quest/AddReward.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/AddReward.h	(revision 2220)
+++ code/branches/questsystem2/src/orxonox/objects/quest/AddReward.h	(revision 2221)
@@ -48,4 +48,12 @@
     @brief
         Adds a list of Rewardables to a player.
+        
+        Creating a AddReward through XML goes as follows:
+        
+        <AddReward>
+            <Rewardable /> //A list of Rewardable objects to be rewarded the player, see the specific Rewardables for their respective XML representations.
+            ...
+            <Rewardable />
+        </AddReward>
     @author
         Damian 'Mozork' Frick
Index: code/branches/questsystem2/src/orxonox/objects/quest/CompleteQuest.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/CompleteQuest.h	(revision 2220)
+++ code/branches/questsystem2/src/orxonox/objects/quest/CompleteQuest.h	(revision 2221)
@@ -48,4 +48,8 @@
     @brief
         Completes a Quest (with a specified id) for the player invoking the QuestEffect.
+        
+        Creating a CompleteQuest through XML goes as follows:
+        
+        <CompleteQuest questId="id" />  //Where id is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information, and identifies the Quest that should be completed.
     @author
         Damian 'Mozork' Frick
Index: code/branches/questsystem2/src/orxonox/objects/quest/FailQuest.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/FailQuest.h	(revision 2220)
+++ code/branches/questsystem2/src/orxonox/objects/quest/FailQuest.h	(revision 2221)
@@ -47,5 +47,9 @@
     /**
     @brief
-        Fails a quest.
+        Fails a quest (with a specified id) for the player invoking the QuestEffect.
+        
+        Creating a FailQuest through XML goes as follows:
+        
+        <FailQuest questId="id" />  //Where id is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information, and identifies the Quest that should be failed.
     @author
         Damian 'Mozork' Frick
Index: code/branches/questsystem2/src/orxonox/objects/quest/QuestDescription.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/QuestDescription.h	(revision 2220)
+++ code/branches/questsystem2/src/orxonox/objects/quest/QuestDescription.h	(revision 2221)
@@ -49,4 +49,8 @@
         This class is a description of a QuestItem.
         It holds a title and a description.
+        
+        Creating a QuestDescription through XML goes as follows:
+        
+        <QuestDescription title="Title" description="Description Text" />
     @author
         Damian 'Mozork' Frick
Index: code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.cc
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.cc	(revision 2220)
+++ code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.cc	(revision 2221)
@@ -27,4 +27,10 @@
  */
 
+/**
+    @file QuestEffectBeacon.cc
+    @brief
+	Implementation of the QuestEffectBeacon class.
+*/
+
 #include "OrxonoxStableHeaders.h"
 #include "QuestEffectBeacon.h"
@@ -44,4 +50,8 @@
     CreateFactory(QuestEffectBeacon);
 
+    /**
+    @brief
+        Constructor. Registers the object and initializes defaults.
+    */
     QuestEffectBeacon::QuestEffectBeacon(BaseObject* creator) : PositionableEntity(creator)
     {
@@ -49,12 +59,18 @@
         
         this->status_ = QuestEffectBeaconStatus::active;
-        this->times_ = -1;
-        this->trigger_ = NULL;
-    }
-
+        this->times_ = INFINITE;
+    }
+
+    /**
+        Destructor.
+    */
     QuestEffectBeacon::~QuestEffectBeacon()
     {
     }
     
+    /**
+    @brief
+        Method for creating a QuestEffectBeacon object through XML.
+    */
     void QuestEffectBeacon::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
@@ -62,25 +78,48 @@
 
         XMLPortParam(QuestEffectBeacon, "times", setTimes, getTimes, xmlelement, mode);
-        XMLPortObject(QuestEffectBeacon, QuestEffect, "", addEffect, getEffect, xmlelement, mode);
-        XMLPortObject(QuestEffectBeacon, PlayerTrigger, "", addTrigger, getTrigger, xmlelement, mode);
-    }
-    
+        XMLPortObject(QuestEffectBeacon, QuestEffect, "effects", addEffect, getEffect, xmlelement, mode);
+    }
+    
+    /**
+    @brief
+        Processes an event for this QuestEffectBeacon.
+    */
     void QuestEffectBeacon::processEvent(Event& event)
     {
+        SUPER(QuestEffectBeacon, processEvent, event);
+    
 	SetSubclassEvent(QuestEffectBeacon, "execute", execute, event, PlayerTrigger);
     }
     
+    /**
+    @brief
+        Executes the QuestEffectBeacon.
+        This means extracting the ControllableEntity from the PlayerTrigger, provided by the Event causing the execution, and the extracting the PlayerInfo from the received ControllableEntity and invoking the QuestEffectbeacon's QuestEffects on the received PlayerInfo.
+    @param b
+        TDO: What is this???
+    @param trigger
+        Apointer to the PlayerTrigger that threw the Event.
+    @return
+        Returns true if successfully executed, false if not.
+    */
     bool QuestEffectBeacon::execute(bool b, PlayerTrigger* trigger)
     {
         if(!b)
         {
+            //TDO: Better message, please.
             COUT(2) << "b is false." << std::endl;
         }
-        if(!(this->isActive()))
+        if(!(this->isActive())) //!< If the QuestEffectBeacon is inactive it cannot be executed.
         {
             COUT(3) << "The QuestEffectBeacon is inactive." << std::endl;
             return false;
         }
-
+        
+        if(!trigger->isForPlayer()) //!< The PlayerTrigger is not exclusively for ControllableEntities which means we cannot extract one.
+        {
+            return false;
+        }
+
+        //! Extracting the ControllableEntity form the PlayerTrigger.
         ControllableEntity* entity = trigger->getTriggeringPlayer();
 
@@ -91,4 +130,5 @@
         }
         
+        //! Extract the PlayerInfo from the ControllableEntity.
         PlayerInfo* player = entity->getPlayer();
         
@@ -99,34 +139,60 @@
         }
 
-        COUT(3) << "QuestEffectBeacon executed on player: " << player << " ." << std::endl;        
-
-        bool check = QuestEffect::invokeEffects(player, this->effects_);
+        COUT(3) << "QuestEffectBeacon executed on player: " << player << " ." << std::endl;
+
+        bool check = QuestEffect::invokeEffects(player, this->effects_); //!< Invoke the QuestEffects on the PlayerInfo.
         if(check)
         {
-            this->decrementTimes();
+            this->decrementTimes(); //!< Decrement the number of times the beacon can be used.
             return true;
 	}
-	
+
 	return false;
     }
     
-    bool QuestEffectBeacon::isActive(void)
-    {
-        return this->status_ == QuestEffectBeaconStatus::active;
-    }
-    
+    /**
+    @brief
+        Set the status of the QuestEffectBeacon.
+    @param activate
+        If true the QuestEffectBeacon is activated, if false it is deactivated.
+    @return
+        Returns whether the activation/deactivation was successful.
+    */
+    bool QuestEffectBeacon::setActive(bool activate)
+    {
+        if(this->getTimes() == 0 && activate) //!< A QuestEffectBeacon that can be executed only 0 times is always inactive.
+        {
+            return false;
+        }
+        
+        if(activate)
+        {
+	    this->status_ = QuestEffectBeaconStatus::active;
+	    return true;
+        }
+        
+        this->status_ = QuestEffectBeaconStatus::inactive;
+        return true;
+    }
+    
+    /**
+    @brief
+        Decrement the number of times the QuestEffectBeacon can be executed.
+    @return
+        Returns true if successful.
+    */
     bool QuestEffectBeacon::decrementTimes(void)
     {
-        if(!(this->isActive()))
-        {
-            return false;
-        }
-        if(this->getTimes() == -1)
+        if(!(this->isActive())) //!< The QuestEffectBeacon mus be active to decrement the number of times it can be executed.
+        {
+            return false;
+        }
+        if(this->getTimes() == INFINITE) //!< If times is infinity the QuestEffectBeacon can be executed an infinite number fo times.
         {
             return true;
         }
         
-        this->times_ = this->times_ - 1;
-	if(this->getTimes() == 0)
+        this->times_ = this->times_ - 1; //!< Decrement number of times the QuestEffectBeacon can be executed.
+	if(this->getTimes() == 0) //!< Set the QuestEffectBeacon to inactive when the number of times it can be executed is reduced to 0.
 	{
             this->status_ = QuestEffectBeaconStatus::inactive;
@@ -136,8 +202,17 @@
     }
     
-    
+    /**
+    @brief
+        Set the number of times the QuestEffectBeacon can be executed.
+        The number must be eighter <= 0, or INFINITY which is '-1'.
+    @param n
+        The number of times the QuestEffectBeacon can be executed.
+        The number must be eighter <= 0, or INFINITY which is '-1'.
+    @return
+        Returns true if successful.
+    */
     bool QuestEffectBeacon::setTimes(const int & n)
     {
-        if(n < -1)
+        if(n < 0 && n != INFINITE)
         {
             return false;
@@ -148,12 +223,15 @@
     }
     
-    
-    /**
-    @brief
-
+    /**
+    @brief
+        Adds a QuestEffect to the QuestEffectBeacon.
+    @param effect
+        A pointer to the QuestEffect to be added.
+    @return
+        Returns true if successful.
     */
     bool QuestEffectBeacon::addEffect(QuestEffect* effect)
     {
-        if(effect == NULL)
+        if(effect == NULL) //!< NULL-pointers are not well liked here...
         {
             COUT(2) << "A NULL-QuestEffect was trying to be added" << std::endl;
@@ -167,25 +245,11 @@
     }
     
-    bool QuestEffectBeacon::addTrigger(PlayerTrigger* trigger)
-    {
-        if(this->trigger_ != NULL)
-	{
-	   COUT(2) << "A Trigger was trying to be added, where one was already set." << std::endl;
-	   return false;
-	}
-	if(trigger == NULL)
-	{
-            COUT(2) << "A NULL-Trigger was trying to be added." << std::endl;
-            return false;
-	}
-	
-	COUT(3) << "A Trigger was added to a QuestEffectBeacon." << std::endl;
-	this->trigger_ = trigger;
-	return true;
-    }
-    
-     /**
-    @brief
-
+    /**
+    @brief
+        Returns the QuestEffect at the given index.
+    @param index
+        The index.
+    @return
+        Returns a pointer to the QuestEffect at the given index.
     */
     const QuestEffect* QuestEffectBeacon::getEffect(unsigned int index) const
@@ -203,13 +267,3 @@
     }
 
-    const PlayerTrigger* QuestEffectBeacon::getTrigger(unsigned int index) const
-    {
-        if(index == 0)
-        {
-            return this->trigger_;
-        }
-        
-        return NULL;
-    }
-
 }
Index: code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.h	(revision 2220)
+++ code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.h	(revision 2221)
@@ -27,4 +27,10 @@
  */
 
+/**
+    @file QuestEffectBeacon.h
+    @brief
+	Definition of the QuestEffectBeacon class.
+*/
+
 #ifndef _QuestEffectBeacon_H__
 #define _QuestEffectBeacon_H__
@@ -37,4 +43,5 @@
 {
 
+    //! The status of the beacon, can be either active or inactive.
     enum Enum
     {
@@ -42,5 +49,5 @@
         active
     };
-    
+
 }
 
@@ -49,7 +56,23 @@
     /**
     @brief
-        A QuestEffectBeacon is an entity which can (under some condition(s)) invoke a number QuestEffects on players meeting the condition(s).
+        A QuestEffectBeacon is a physical entity in the game which can (under some condition(s)) invoke a number QuestEffects on players meeting the condition(s).
         The conditions under which the QuestEffects are invoked on the player are defined by Triggers.
         A QuestEffectBeacon can be executed a defined number of times.
+        A QuestEffectBeacon can be inactive or active.
+        
+	Creating a QuestEffectBeacon through XML goes as follows:
+	
+	<QuestEffectBeacon times=n> //Where 'n' is eighter a number >= 0, which means the QuestEffectBeacon can be executed n times. Or n = -1, which means the QuestEffectBeacon can be executed an infinite number of times.
+            <effects>
+                <QuestEffect /> //A list of QuestEffects, invoked when the QuestEffectBeacon is executed, see QuestEffect for the full XML representation.
+                ...
+                <QuestEffect />
+            </effects>
+            <events>
+		<execute>
+		    <PlayerTrigger /> //A PlayerTrigger triggering the execution of the QuestEffectBeacon.
+		</execute>
+	    </events>
+	</QuestEffectBeacon>
     @author
         Damian 'Mozork' Frick
@@ -61,30 +84,40 @@
 	    virtual ~QuestEffectBeacon();
 	    
-	    virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+	    virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestEffectBeacon object through XML.
 	    
-	    virtual void processEvent(Event& event);
+	    virtual void processEvent(Event& event); //!< Processes an event for this QuestEffectBeacon.
 	    
 	    bool execute(bool b, PlayerTrigger* trigger); //!< Executes the QuestEffects of the QuestEffectBeacon.
 	    
-	    bool isActive(void); //!< Test whether the QuestEffectBeacon is active.
+	    /**
+	    @brief Tests whether the QuestEffectBeacon is active.
+	    @return Returns true if the QuestEffectBeacon is active, fals if not.
+	    */
+	    inline bool isActive(void)
+	       { return this->status_ == QuestEffectBeaconStatus::active; }
+	    
+	    bool setActive(bool activate); //!< Set the status of the QuestEffectBeacon.
 	    
 	protected:
             bool decrementTimes(void); //!< Decrement the number of times the QuestEffectBeacon can still be executed.
             
-            inline const int & getTimes(void) const //!< Return the number of times the QUestEffectBeacon can still be executed.
+            /**
+            @brief Returns the number of times the QUestEffectBeacon can still be executed.
+            @return Returns the number of times the QUestEffectBeacon can still be executed.
+            */
+            inline const int & getTimes(void) const
                 { return this->times_; }
 
         private:
+            static const int INFINITE = -1; //!< Constant to avoid using magic numbers.
+        
             std::list<QuestEffect*> effects_; //!< The list of QuestEffects to be invoked on the executing player.
             int times_; //!< Number of times the beacon can be exectued.
             QuestEffectBeaconStatus::Enum status_; //!< The status of the QUestEffectBeacon, Can be eighter active or inactive.
-            PlayerTrigger* trigger_;
             
             bool setTimes(const int & n); //!< Set the number of times the QuestEffectBeacon can be executed.
-            bool addEffect(QuestEffect* effect);
-            bool addTrigger(PlayerTrigger* trigger);
+            bool addEffect(QuestEffect* effect); //!< Add a QuestEffect to the QuestEffectBeacon.
             
-            const QuestEffect* getEffect(unsigned int index) const;
-            const PlayerTrigger* getTrigger(unsigned int index) const;
+            const QuestEffect* getEffect(unsigned int index) const; //!< Get the QuestEffect at a given index.
     
     };
Index: code/branches/questsystem2/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc	(revision 2220)
+++ code/branches/questsystem2/src/orxonox/objects/worldentities/triggers/DistanceTrigger.cc	(revision 2221)
@@ -35,4 +35,6 @@
 #include "core/XMLPort.h"
 
+#include "orxonox/objects/worldentities/ControllableEntity.h"
+
 namespace orxonox
 {
@@ -45,5 +47,5 @@
     this->distance_ = 100;
     this->targetMask_.exclude(Class(BaseObject));
-    this->setForPlayer(false);
+    this->setForPlayer(false); //!< Normally hasn't just ControllableEntities as targets.
   }
 
@@ -83,11 +85,13 @@
   void DistanceTrigger::addTargets(const std::string& targets)
   {
-  
-    if(targets == "ControllableEntity")
+    Identifier* targetId = ClassByString(targets);
+    
+    //! Checks whether the target is (or is derived from) a ControllableEntity.
+    Identifier* controllableEntityId = Class(ControllableEntity);
+    if(targetId->isA(controllableEntityId))
     {
-        this->setForPlayer(true);
+      this->setForPlayer(true);
     }
-  
-    Identifier* targetId = ClassByString(targets);
+    
     if (!targetId)
     {
@@ -125,8 +129,10 @@
       if (distanceVec.length() < this->distance_)
       {
+        
+        //! If the target is a player (resp. is a, or is derived from a, ControllableEntity) the triggeringPlayer is set to the target entity.
         if(this->isForPlayer())
 	{
-            ControllableEntity* player = dynamic_cast<ControllableEntity*>(entity);
-            this->setTriggeringPlayer(player);
+          ControllableEntity* player = dynamic_cast<ControllableEntity*>(entity);
+	  this->setTriggeringPlayer(player);
 	}
         
Index: code/branches/questsystem2/src/orxonox/objects/worldentities/triggers/PlayerTrigger.cc
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/worldentities/triggers/PlayerTrigger.cc	(revision 2220)
+++ code/branches/questsystem2/src/orxonox/objects/worldentities/triggers/PlayerTrigger.cc	(revision 2221)
@@ -27,10 +27,21 @@
  */
 
+/**
+    @file PlayerTrigger.cc
+    @brief
+	Implementation of the PlayerTrigger class.
+*/
+
+#include "OrxonoxStableHeaders.h"
+#include "PlayerTrigger.h"
+
 #include "core/CoreIncludes.h"
-
-#include "PlayerTrigger.h"
 
 namespace orxonox {
 
+    /**
+    @brief
+        Constructor. Registers the object and initializes defaults.
+    */
     PlayerTrigger::PlayerTrigger(BaseObject* creator) : Trigger(creator)
     {
@@ -41,9 +52,16 @@
     }
     
-    
+    /**
+    @brief
+        Destructor.
+    */
     PlayerTrigger::~PlayerTrigger()
     {
     }
 
+    /**
+    @brief
+        Method for creating a QuestEffectBeacon object through XML.
+    */
     void PlayerTrigger::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
Index: code/branches/questsystem2/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h
===================================================================
--- code/branches/questsystem2/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h	(revision 2220)
+++ code/branches/questsystem2/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h	(revision 2221)
@@ -26,7 +26,15 @@
  *
  */
- 
+
+/**
+    @file PlayerTrigger.h
+    @brief
+	Definition of the PlayerTrigger class.
+*/
+
 #ifndef _PlayerTrigger_H__
 #define _PlayerTrigger_H__
+
+#include "OrxonoxPrereqs.h"
 
 #include "Trigger.h"
@@ -36,5 +44,5 @@
     /**
     @brief
-        
+        A PlayerTrigger is a trigger which is normally triggered by ControllableEntities and can as such return a pointer to the ControllableEntity which triggered it.
     @author
         Damian 'Mozork' Frick
@@ -46,22 +54,40 @@
 	    virtual ~PlayerTrigger();
 	    
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a PlayerTrigger object through XML.
             
+            /**
+            @brief Returns the player that triggered the PlayerTrigger.
+            @return Returns a pointer to the ControllableEntity that triggered the PlayerTrigger.
+            */
             inline ControllableEntity* getTriggeringPlayer(void) const
                 { return this->player_; }
+	    
+	    /**
+	    @brief Checks whether the PlayerTrigger normally returns a ControllableEntity.
+	    @return Returns true if the PlayerTrigger normally returns a ControllableEntity.
+	    */
+	    inline bool isForPlayer(void) const
+	       { return this->isForPlayer_; }
             
 	protected:
 	    virtual bool isTriggered(TriggerMode mode) = 0;
 	    
+	    /**
+	    @brief Set the player that triggered the PlayerTrigger. This is normally done by classes inheriting vom PlayerTrigger.
+	    @param player A pointer to the ControllableEntity that triggered the PlayerTrigger.
+	    */
 	    inline void setTriggeringPlayer(ControllableEntity* player)
 	       { this->player_ = player; }
-	    inline bool isForPlayer(void) const
-	       { return this->isForPlayer_; }
+
+            /**
+            @brief Set whether the PlayerTrigger normally is triggered by ControllableEntities.
+            @param isForPlayer Should be true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities, false if not.
+            */
 	    inline void setForPlayer(bool isForPlayer)
 	       { this->isForPlayer_ = isForPlayer; }
 	    
 	private:
-	    ControllableEntity* player_;
-	    bool isForPlayer_;
+	    ControllableEntity* player_; //!< The player that triggered the PlayerTrigger.
+	    bool isForPlayer_; //!< Is true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities.
 	
     };
