Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 8, 2008, 7:58:49 PM (16 years ago)
Author:
dafrick
Message:

Completed documentation of finished classes.

Location:
code/branches/questsystem2/src/orxonox/objects/quest
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem2/src/orxonox/objects/quest/AddQuest.cc

    r2146 r2159  
    2727 */
    2828
     29/**
     30    @file AddQuest.cc
     31    @brief
     32        Implementation of the AddQuest class.
     33*/
     34
    2935#include "OrxonoxStableHeaders.h"
    3036#include "AddQuest.h"
     
    4349    CreateFactory(AddQuest);
    4450
    45 
     51    /**
     52    @brief
     53        Constructor. Registers the quest.
     54    */
    4655    AddQuest::AddQuest(BaseObject* creator) : ChangeQuestStatus(creator)
    4756    {
     
    5766    }
    5867
     68    /**
     69    @brief
     70        Method for creating a AddQuest object through XML.
     71    */
    5972    void AddQuest::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    6073    {
     
    7386    bool AddQuest::invoke(ControllableEntity* player)
    7487    {
    75         if(player == NULL)
     88        if(player == NULL) //!< Null-pointers are badass.
    7689        {
    7790            COUT(2) << "Input player is NULL." << std::endl;
  • code/branches/questsystem2/src/orxonox/objects/quest/AddQuest.h

    r2146 r2159  
    2727 */
    2828
     29/**
     30    @file AddQuest.h
     31    @brief
     32        Definition of the AddQuest class.
     33*/
     34
    2935#ifndef _AddQuest_H__
    3036#define _AddQuest_H__
     
    4147    /**
    4248    @brief
    43         Adds a quest, resp. changes the quests status to active.
     49        Adds a quest, resp. changes the quests status to active for the player invoking the quest.
    4450    @author
    4551        Damian 'Mozork' Frick
     
    5157            virtual ~AddQuest();
    5258
    53             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     59            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddQuest object through XML.
    5460
    5561            virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.
  • code/branches/questsystem2/src/orxonox/objects/quest/AddQuestHint.cc

    r2146 r2159  
    2727 */
    2828
     29/**
     30    @file AddQuestHint.cc
     31    @brief
     32        Implementation of the AddQuestHint class.
     33*/
     34
    2935#include "OrxonoxStableHeaders.h"
    3036#include "AddQuestHint.h"
     
    4248    CreateFactory(AddQuestHint);
    4349
     50    /**
     51    @brief
     52        Constructor. Registers the object.
     53    */
    4454    AddQuestHint::AddQuestHint(BaseObject* creator) : QuestEffect(creator)
    4555    {
     
    5565    }
    5666
     67    /**
     68    @brief
     69        Method for creating a AddQuestHint object through XML.
     70    */
    5771    void AddQuestHint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    5872    {
     
    6377    }
    6478
     79    /**
     80    @brief
     81        Sets the id of the quest hint to be added to the player the effect is invoked on.
     82    @param id
     83        The QuestHint id.
     84    @param
     85        Returns true if successful.
     86    */
    6587    inline void AddQuestHint::setHintId(const std::string & id)
    6688    {
     
    6890        {
    6991            COUT(2) << "Invalid id. QuestItem id {" << id << "} could not be set." << std::endl;
    70             return;
     92            return false;
    7193        }
     94       
    7295        this->hintId_ = id;
     96        return true;
    7397    }
    7498
     
    83107    bool AddQuestHint::invoke(ControllableEntity* player)
    84108    {
    85         if(player == NULL)
     109        if(player == NULL) //!< NULL-pointers are evil!
    86110        {
    87111            COUT(2) << "The input player is NULL." << std::endl;
  • code/branches/questsystem2/src/orxonox/objects/quest/AddQuestHint.h

    r2146 r2159  
    2727 */
    2828
     29/**
     30    @file AddQuestHint.h
     31    @brief
     32        Definition of the AddQuestHint class.
     33*/
     34
    2935#ifndef _AddQuestHint_H__
    3036#define _AddQuestHint_H__
     
    4046    /**
    4147    @brief
    42         Adds a QuestHint, resp. Activates the QuestHint.
     48        Adds a QuestHint, resp. activates the QuestHint of the given id for the player the effect is invoked on.
    4349    @author
    4450        Damian 'Mozork' Frick
     
    5056            virtual ~AddQuestHint();
    5157
    52             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     58            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddQuestHint object through XML.
    5359
    5460            virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.
    5561
    5662        private:
    57             std::string hintId_;
     63            std::string hintId_; //!< The id of the QuestHint.
    5864
    59             inline const std::string & getHintId(void) const
     65            inline const std::string & getHintId(void) const //!< Returns the if of the hint.
    6066                { return this->hintId_; }
    61             void setHintId(const std::string & id);
     67            void setHintId(const std::string & id); //!< Sets the id of the hint.
    6268
    6369    };
  • code/branches/questsystem2/src/orxonox/objects/quest/AddReward.cc

    r2146 r2159  
    2727 */
    2828
     29/**
     30    @file AddReward.cc
     31    @brief
     32        Implementation of the AddReward class.
     33*/
     34
    2935#include "OrxonoxStableHeaders.h"
    3036#include "AddReward.h"
     
    3945    CreateFactory(AddReward);
    4046
     47    /**
     48    @brief
     49        Constructor. Registers the object.
     50    */
    4151    AddReward::AddReward(BaseObject* creator) : QuestEffect(creator)
    4252    {
    4353        RegisterObject(AddReward);
    44 
    45         this->initialize();
    4654    }
    4755
     
    5462    }
    5563
     64    /**
     65        Method for creating a AddReward object through XML.
     66    */
    5667    void AddReward::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    5768    {
     
    6475    /**
    6576    @brief
    66         Initializes the object. Needs to be called first by every constructor of this class.
     77        Returns the rewardbale object at the given index.
     78    @param index
     79        The index.
     80    @return
     81        Returns a pointer to the rewardable object at the given index.
    6782    */
    68     void AddReward::initialize(void)
    69     {
    70         RegisterObject(AddReward);
    71     }
    72 
    7383    const Rewardable* AddReward::getRewardables(unsigned int index) const
    7484    {
  • code/branches/questsystem2/src/orxonox/objects/quest/AddReward.h

    r2146 r2159  
    2727 */
    2828
     29/**
     30    @file AddReward.h
     31    @brief
     32        Definition of the AddReward class.
     33*/
     34
    2935#ifndef _AddReward_H__
    3036#define _AddReward_H__
     
    5157            virtual ~AddReward();
    5258
    53             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     59            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddReward object through XML.
    5460
    5561            virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.
    5662
    5763        private:
    58             std::list<Rewardable*> rewards_;
     64            std::list<Rewardable*> rewards_; //!< A list of rewards to be added to the player invoking the effect.
    5965
    60             void initialize(void); //!< Initializes the object.
    61 
    62             inline void addRewardable(Rewardable* reward)
     66            inline void addRewardable(Rewardable* reward) //!< Add a rewardable object to the list of objects to be awarded to the player invoking the effect.
    6367                { this->rewards_.push_back(reward); }
    64             const Rewardable* getRewardables(unsigned int index) const;
     68            const Rewardable* getRewardables(unsigned int index) const; //!< Returns the rewardable object at the given index.
    6569
    6670    };
  • code/branches/questsystem2/src/orxonox/objects/quest/ChangeQuestStatus.cc

    r2105 r2159  
    2727 */
    2828
     29/**
     30    @file ChangeQuestStatus.cc
     31    @brief
     32        Implementation of the ChangeQuestStatus class.
     33*/
     34
    2935#include "OrxonoxStableHeaders.h"
    3036#include "ChangeQuestStatus.h"
     
    3642namespace orxonox {
    3743
     44    /**
     45    @brief
     46        Constructor. Registers the object.
     47    */
    3848    ChangeQuestStatus::ChangeQuestStatus(BaseObject* creator) : QuestEffect(creator)
    3949    {
     
    4959    }
    5060
    51     void ChangeQuestStatus::setQuestId(const std::string & id)
     61    /**
     62    @brief
     63        Sets the id of the quest the effect chagnes the status of.
     64    @param id
     65        The id of the quest.
     66    @return
     67        Returns true if successful.
     68    */
     69    bool ChangeQuestStatus::setQuestId(const std::string & id)
    5270    {
    5371        if(!QuestItem::isId(id))
    5472        {
    5573            COUT(2) << "Invalid id. QuestItem id {" << id << "} could not be set." << std::endl;
    56             return;
     74            return false;
    5775        }
     76       
    5877        this->questId_ = id;
     78        return true;
    5979    }
    6080
     81    /**
     82    @brief
     83        Method for creating a ChangeQuestStatus object through XML.
     84    */
    6185    void ChangeQuestStatus::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    6286    {
  • code/branches/questsystem2/src/orxonox/objects/quest/ChangeQuestStatus.h

    r2146 r2159  
    2727 */
    2828
     29/**
     30    @file ChangeQuestStatus.h
     31    @brief
     32        Definition of the ChangeQuestStatus class.
     33*/
     34
    2935#ifndef _ChangeQuestStatus_H__
    3036#define _ChangeQuestStatus_H__
     
    4147    /**
    4248    @brief
    43         An effect which changes a quests status.
     49        An effect which changes a quests status of a specified quest for the player invoking the effect.
    4450    @author
    4551        Damian 'Mozork' Frick
     
    5157            virtual ~ChangeQuestStatus();
    5258
    53             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     59            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a ChangeQuestStatus object through XML.
    5460
    5561            virtual bool invoke(ControllableEntity* player) = 0; //!< Invokes the effect.
     
    5965                { return this->questId_; }
    6066
     67        private:
    6168            std::string questId_; //!< The id of the quest the status should be changed of.
    62 
    63         private:
    64             void setQuestId(const std::string & id);
     69           
     70            void setQuestId(const std::string & id); //!< Sets the quest id.
    6571
    6672    };
  • code/branches/questsystem2/src/orxonox/objects/quest/CompleteQuest.cc

    r2146 r2159  
    2626 *
    2727 */
     28 
     29/**
     30    @file CompleteQuest.cc
     31    @brief
     32        Implementation of the CompleteQuest class.
     33*/
    2834
    2935#include "OrxonoxStableHeaders.h"
     
    4147    CreateFactory(CompleteQuest);
    4248
     49    /**
     50    @brief
     51        Constructor. Registers the object.
     52    */
    4353    CompleteQuest::CompleteQuest(BaseObject* creator) : ChangeQuestStatus(creator)
    4454    {
     
    5464    }
    5565
     66    /**
     67    @brief
     68        Method for creating a CompleteQuest object through XML.
     69    */
    5670    void CompleteQuest::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    5771    {
     
    6983    bool CompleteQuest::invoke(ControllableEntity* player)
    7084    {
    71         if(player == NULL)
     85        if(player == NULL) //!< You know, what we think of NULL-pointers...
    7286        {
    7387            COUT(2) << "Input player is NULL." << std::endl;
  • code/branches/questsystem2/src/orxonox/objects/quest/CompleteQuest.h

    r2146 r2159  
    2727 */
    2828
     29/**
     30    @file CompleteQuest.h
     31    @brief
     32        Definition of the CompleteQuest class.
     33*/
     34
    2935#ifndef _CompleteQuest_H__
    3036#define _CompleteQuest_H__
     
    4147    /**
    4248    @brief
    43         Completes a quest.
     49        Completes a quest (with a specified id) for the player invoking the effect.
    4450    @author
    4551        Damian 'Mozork' Frick
     
    5157            virtual ~CompleteQuest();
    5258
    53             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     59            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a CompleteQuest object through XML.
    5460
    5561            virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.
  • code/branches/questsystem2/src/orxonox/objects/quest/FailQuest.cc

    r2146 r2159  
    2626 *
    2727 */
     28 
     29/**
     30    @file FailQuest.cc
     31    @brief
     32        Implementation of the FailQuest class.
     33*/
    2834
    2935#include "OrxonoxStableHeaders.h"
     
    4147    CreateFactory(FailQuest);
    4248
     49    /**
     50    @brief
     51        Constructor. Registers the object.
     52    */
    4353    FailQuest::FailQuest(BaseObject* creator) : ChangeQuestStatus(creator)
    4454    {
     
    5464    }
    5565
     66    /**
     67    @brief
     68        Method for creating a FailQuest object through XML.
     69    */
    5670    void FailQuest::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    5771    {
     
    6983    bool FailQuest::invoke(ControllableEntity* player)
    7084    {
    71         if(player == NULL)
     85        if(player == NULL) //!< We don't know what to do with no player.
    7286        {
    7387            COUT(2) << "Input player is NULL." << std::endl;
  • code/branches/questsystem2/src/orxonox/objects/quest/FailQuest.h

    r2146 r2159  
    2727 */
    2828
     29/**
     30    @file FailQuest.h
     31    @brief
     32        Definition of the FailQuest class.
     33*/
     34
    2935#ifndef _FailQuest_H__
    3036#define _FailQuest_H__
     
    5157            virtual ~FailQuest();
    5258
    53             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     59            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a FailQuest object through XML.
    5460
    5561            virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.
  • code/branches/questsystem2/src/orxonox/objects/quest/GlobalQuest.cc

    r2146 r2159  
    4848    /**
    4949    @brief
    50         Constructor. Initializes the object.
     50        Constructor. Registers the object.
    5151    */
    5252    GlobalQuest::GlobalQuest(BaseObject* creator) : Quest(creator)
    53     {
    54         this->initialize();
    55     }
    56    
    57     /**
    58     @brief
    59         Initializes the object.
    60     */
    61     void GlobalQuest::initialize(void)
    6253    {
    6354        RegisterObject(GlobalQuest);
     
    10495            for(std::set<ControllableEntity*>::const_iterator it = players_.begin(); it != players_.end(); it++)
    10596            {
    106                 QuestEffect::invokeEffects(*it, this->failEffects_);
     97                QuestEffect::invokeEffects(*it, this->getFailEffectList());
    10798            }
    10899
     
    133124            for(std::set<ControllableEntity*>::const_iterator it = players_.begin(); it != players_.end(); it++)
    134125            {
    135                 QuestEffect::invokeEffects(*it, this->completeEffects_);
     126                QuestEffect::invokeEffects(*it, this->getCompleteEffectList());
    136127            }
    137128           
  • code/branches/questsystem2/src/orxonox/objects/quest/GlobalQuest.h

    r2146 r2159  
    111111            const QuestEffect* getRewardEffects(unsigned int index) const; //!< Returns the reward effect at the given index.
    112112
    113             void initialize(void); //!< Initializes the object.
    114 
    115113    };
    116114
  • code/branches/questsystem2/src/orxonox/objects/quest/LocalQuest.cc

    r2146 r2159  
    4848    /**
    4949    @brief
    50         Constructor. Initializes the object.
     50        Constructor. Registers and initializes the object.
    5151    */
    5252    LocalQuest::LocalQuest(BaseObject* creator) : Quest(creator)
    53     {
    54         this->initialize();
    55     }
    56    
    57     /**
    58     @brief
    59         Initializes the object.
    60     */
    61     void LocalQuest::initialize(void)
    6253    {
    6354        RegisterObject(LocalQuest);
     
    9889        {
    9990            this->setStatus(player, questStatus::failed);
    100             QuestEffect::invokeEffects(player, this->failEffects_); //!< Invoke the failEffects.
     91            QuestEffect::invokeEffects(player, this->getFailEffectList()); //!< Invoke the failEffects.
    10192            return true;
    10293        }
     
    120111        {
    121112            this->setStatus(player, questStatus::completed);
    122             QuestEffect::invokeEffects(player, this->completeEffects_); //!< Invoke the completeEffects.
     113            QuestEffect::invokeEffects(player, this->getCompleteEffectList()); //!< Invoke the completeEffects.
    123114            return true;
    124115        }
  • code/branches/questsystem2/src/orxonox/objects/quest/LocalQuest.h

    r2146 r2159  
    101101            std::map<ControllableEntity*, questStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
    102102
    103             void initialize(void); //!< Initializes the object.
    104 
    105103    };
    106104
  • code/branches/questsystem2/src/orxonox/objects/quest/Quest.cc

    r2146 r2159  
    4848    /**
    4949    @brief
    50         Constructor. Initializes object.
     50        Constructor. Registers and initializes object.
    5151    */
    5252    Quest::Quest(BaseObject* creator) : QuestItem(creator)
    5353    {
    54         this->initialize();
    55     }
    56    
    57     /**
    58     @brief
    59         Initializes the object. Needs to be called first in every constructor of this class.
    60         Sets defaults.
    61     */
    62     void Quest::initialize(void)
    63     {
    6454        RegisterObject(Quest);
    6555
     
    8474        SUPER(Quest, XMLPort, xmlelement, mode);
    8575
    86         XMLPortObject(Quest, Quest, "subquests", addSubQuest, getSubQuests, xmlelement, mode);
    87         XMLPortObject(Quest, QuestHint, "hints", addHint, getHints, xmlelement, mode);
    88         XMLPortObject(Quest, QuestEffect, "fail-effects", addFailEffect, getFailEffects, xmlelement, mode);
    89         XMLPortObject(Quest, QuestEffect, "complete-effects", addCompleteEffect, getCompleteEffects, xmlelement, mode);
     76        XMLPortObject(Quest, Quest, "subquests", addSubQuest, getSubQuest, xmlelement, mode);
     77        XMLPortObject(Quest, QuestHint, "hints", addHint, getHint, xmlelement, mode);
     78        XMLPortObject(Quest, QuestEffect, "fail-effects", addFailEffect, getFailEffect, xmlelement, mode);
     79        XMLPortObject(Quest, QuestEffect, "complete-effects", addCompleteEffect, getCompleteEffect, xmlelement, mode);
    9080
    9181        QuestManager::registerQuest(this); //Registers the quest with the QuestManager.
     
    224214        Returns the subquest of the given index. NULL if there is no element on the given index.
    225215    */
    226     const Quest* Quest::getSubQuests(unsigned int index) const
     216    const Quest* Quest::getSubQuest(unsigned int index) const
    227217    {
    228218        int i = index;
     
    249239        Returns the hint of the given index. NULL if there is no element on the given index.
    250240    */
    251     const QuestHint* Quest::getHints(unsigned int index) const
     241    const QuestHint* Quest::getHint(unsigned int index) const
    252242    {
    253243        int i = index;
     
    273263        Returns the failEffect of the given index. NULL if there is no element on the given index.
    274264    */
    275     const QuestEffect* Quest::getFailEffects(unsigned int index) const
     265    const QuestEffect* Quest::getFailEffect(unsigned int index) const
    276266    {
    277267        int i = index;
     
    297287        Returns the completeEffect of the given index. NULL if there is no element on the given index.
    298288    */
    299     const QuestEffect* Quest::getCompleteEffects(unsigned int index) const
     289    const QuestEffect* Quest::getCompleteEffect(unsigned int index) const
    300290    {
    301291        int i = index;
  • code/branches/questsystem2/src/orxonox/objects/quest/Quest.h

    r2146 r2159  
    8787            inline const std::list<Quest*> & getSubQuestList(void) const //!< Returns the list of sub quests.
    8888                { return this->subQuests_; }
     89            inline const std::list<QuestHint*> & getHintsList(void) const //!< Returns the list of all hints of this quest.
     90                { return this->hints_; }
    8991
    9092            bool isInactive(const ControllableEntity* player) const; //!< Returns true if the quest status for the specific player is 'inactive'.
     
    98100
    99101        protected:
    100             void initialize(void); //!< Initializes the object.
    101 
    102102            virtual bool isStartable(const ControllableEntity* player) const = 0; //!< Checks whether the quest can be started.
    103103            virtual bool isFailable(const ControllableEntity* player) const = 0; //!< Checks whether the quest can be failed.
    104104            virtual bool isCompletable(const ControllableEntity* player) const = 0; //!< Checks whether the quest can be completed.
    105105
    106             bool setParentQuest(Quest* quest); //!< Sets the parent quest of the quest.
    107             bool addSubQuest(Quest* quest); //!< Adds a sub quest to the quest.
    108             bool addHint(QuestHint* hint); //!< Add a hint to the list of hints.
    109             bool addFailEffect(QuestEffect* effect); //!< Adds an effect to the list of failEffects.
    110             bool addCompleteEffect(QuestEffect* effect); //!< Adds an effect to the list of completeEffects.
    111 
    112106            const Quest* getParentQuest(void); //!< Returns the parent quest of the quest.
    113             const Quest* getSubQuests(unsigned int index) const; //!<Returns the sub quest of the given index.
    114             const QuestHint* getHints(unsigned int index) const; //!< Returns the hint of the given index.
    115             const QuestEffect* getFailEffects(unsigned int index) const; //!< Returns the failEffect of the given index.
    116             const QuestEffect* getCompleteEffects(unsigned int index) const; //!Returns the completeEffect of the given index.
     107            const Quest* getSubQuest(unsigned int index) const; //!<Returns the sub quest of the given index.
     108            const QuestHint* getHint(unsigned int index) const; //!< Returns the hint of the given index.
     109            const QuestEffect* getFailEffect(unsigned int index) const; //!< Returns the failEffect of the given index.
     110            const QuestEffect* getCompleteEffect(unsigned int index) const; //!< Returns the completeEffect of the given index.
     111            inline std::list<QuestEffect*> & getFailEffectList(void) //!< Returns the list of failEffects.
     112                { return this->failEffects_; }
     113            inline std::list<QuestEffect*> & getCompleteEffectList(void) //!< Returns the list of completeEffects.
     114                { return this->completeEffects_; }
    117115
    118116            virtual questStatus::Enum getStatus(const ControllableEntity* player) const = 0; //!< Returns the status of the quest for a specific player.
    119117            virtual bool setStatus(ControllableEntity* player, const questStatus::Enum & status) = 0; //!< Changes the status for a specific player.
    120 
     118           
     119        private:
    121120            Quest* parentQuest_; //!< Pointer to the parent quest.
    122121            std::list<Quest*> subQuests_; //!< List of all the sub quests.
     
    126125            std::list<QuestEffect*> failEffects_; //!< A list of all effects to be invoked, when the quest has been failed.
    127126            std::list<QuestEffect*> completeEffects_; //!< A list of effects to be invoked, when the quest has been completed.
     127           
     128            bool setParentQuest(Quest* quest); //!< Sets the parent quest of the quest.
     129            bool addSubQuest(Quest* quest); //!< Adds a sub quest to the quest.
     130            bool addHint(QuestHint* hint); //!< Add a hint to the list of hints.
     131            bool addFailEffect(QuestEffect* effect); //!< Adds an effect to the list of failEffects.
     132            bool addCompleteEffect(QuestEffect* effect); //!< Adds an effect to the list of completeEffects.
    128133
    129134    };
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestDescription.cc

    r2105 r2159  
    2727 */
    2828
     29/**
     30    @file QuestDescription.cc
     31    @brief
     32        Implementation of the QuestDescription class.
     33*/
     34
    2935#include "OrxonoxStableHeaders.h"
    3036#include "QuestDescription.h"
     
    3642    CreateFactory(QuestDescription);
    3743
     44    /**
     45    @brief
     46        Constructor. Registers and initializes the object.
     47    */
    3848    QuestDescription::QuestDescription(BaseObject* creator) : BaseObject(creator)
    3949    {
    4050        RegisterObject(QuestDescription);
    41 
    42         this->initialize();
     51       
     52        this->title_ = "";
     53        this->description_ = "";
    4354    }
    4455
     56    /**
     57    @brief
     58        Destructor.
     59    */
    4560    QuestDescription::~QuestDescription()
    4661    {
     
    4863    }
    4964
     65    /**
     66    @brief
     67        Method for creating a QuestDescription object through XML.
     68    */
    5069    void QuestDescription::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    5170    {
     
    5877    }
    5978
    60     /**
    61     @brief
    62         Initializes the object. Has to be called first in every constructor of this class.
    63     */
    64     void QuestDescription::initialize(void)
    65     {
    66         RegisterObject(QuestDescription);
    67     }
    68 
    6979
    7080}
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestDescription.h

    r2096 r2159  
    2727 */
    2828
     29/**
     30    @file QuestDescription.h
     31    @brief
     32        Definition of the QuestDescription class.
     33*/
     34
    2935#ifndef _QuestDescription_H__
    3036#define _QuestDescription_H__
     
    5258            virtual ~QuestDescription();
    5359
    54             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     60            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestDescription object through XML.
    5561
    5662            inline const std::string & getTitle(void) const //!< Returns the title.
     
    6066
    6167        private:
    62             void initialize(void);
     68            std::string title_; //!< The title.
     69            std::string description_; //!< The description.
    6370
    6471            inline void setTitle(const std::string & title) //!< Sets the title.
     
    6774                { this->description_ = description; }
    6875
    69             std::string title_; //!< The title.
    70             std::string description_; //!< The description.
    71 
    7276    };
    7377
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestEffect.cc

    r2146 r2159  
    2626 *
    2727 */
     28
     29/**
     30    @file QuestEffect.cc
     31    @brief
     32        Implementation of the QuestEffect class.
     33*/
    2834
    2935#include "OrxonoxStableHeaders.h"
     
    5763    /**
    5864    @brief
    59         Static method. Invoke all effects of an effect list.
     65        Static method. Invoke all effects in an effect list on a given player.
    6066    @param player
    6167        The player the effects are invoked on.
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestEffect.h

    r2146 r2159  
    2626 *
    2727 */
     28 
     29/**
     30    @file QuestEffect.h
     31    @brief
     32        Definition of the QuestEffect class.
     33*/
    2834
    2935#ifndef _QuestEffect_H__
     
    4147    @brief
    4248        Handles effects for quests.
     49        QuestEffects are the only way for quests to have any sideeffects in the game world. They are also the only way to gain, complete or fail quests.
    4350    @author
    4451        Damian 'Mozork' Frick
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestHint.cc

    r2146 r2159  
    4848    /**
    4949    @brief
    50         Constructor. Initializes the object.
     50        Constructor. Registers the object.
    5151    */
    5252    QuestHint::QuestHint(BaseObject* creator) : QuestItem(creator)
    53     {
    54         this->initialize();
    55     }
    56    
    57     /**
    58     @brief
    59         Initialize the object.
    60     */
    61     void QuestHint::initialize(void)
    6253    {
    6354        RegisterObject(QuestHint);
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestHint.h

    r2146 r2159  
    9494            std::map<ControllableEntity*, questHintStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
    9595
    96             void initialize(void); //!< Initializes the object.
    97 
    9896    };
    9997
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestItem.cc

    r2146 r2159  
    4747    */
    4848    QuestItem::QuestItem(BaseObject* creator) : BaseObject(creator)
    49     {
    50         RegisterObject(QuestItem);
    51 
    52         this->initialize();
    53     }
    54    
    55     /**
    56     @brief
    57         Initializes the object.
    58         Should be called first in every constructor of this class.
    59     */
    60     void QuestItem::initialize(void)
    6149    {
    6250        RegisterObject(QuestItem);
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestItem.h

    r2146 r2159  
    8181            QuestDescription* description_; //!< The description of the QuestItem.
    8282
    83             void initialize(void); //!< Initializes the object.
    84 
    8583    };
    8684
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestManager.cc

    r2105 r2159  
    2727 */
    2828
     29/**
     30    @file QuestManager.cc
     31    @brief
     32        Implementation of the QuestManager class.
     33*/
     34
    2935#include "OrxonoxStableHeaders.h"
    3036#include "QuestManager.h"
     
    3844namespace orxonox {
    3945
    40     std::map<std::string, Quest*> QuestManager::questMap_;
    41     std::map<std::string, QuestHint*> QuestManager::hintMap_;
    42 
     46    //! All quests registered by their id's.
     47    std::map<std::string, Quest*> QuestManager::questMap_s;
     48    //! All hints registered by their id's.
     49    std::map<std::string, QuestHint*> QuestManager::hintMap_s;
     50
     51    /**
     52    @brief
     53        Constructor. Registers the object.
     54    */
    4355    QuestManager::QuestManager(BaseObject* creator) : BaseObject(creator)
    4456    {
     
    4658    }
    4759
    48 
     60    /**
     61    @brief
     62        Destructor.
     63    */
    4964    QuestManager::~QuestManager()
    5065    {
     
    5570    @brief
    5671        Registers a quest with the QuestManager to make it globally accessable.
     72        Uses it's id to make sure to be able to be identify and retrieve it later.
    5773    @param quest
    5874        The quest that is to be registered.
     
    6278    bool QuestManager::registerQuest(Quest* quest)
    6379    {
    64         if(quest == NULL)
     80        if(quest == NULL) //!< Doh! Just as if there were actual quests behind NULL-pointers.
    6581        {
    6682            COUT(2) << "Registration of Quest in QuestManager failed, because inserted Quest-pointer was NULL." << std::endl;
     
    6884        }
    6985
    70         std::pair<std::map<std::string, Quest*>::iterator,bool> ret;
    71         ret = questMap_.insert( std::pair<std::string,Quest*>(quest->getId(),quest) );
    72 
    73         if(ret.second)
     86        std::pair<std::map<std::string, Quest*>::iterator,bool> result;
     87        result = questMap_s.insert( std::pair<std::string,Quest*>(quest->getId(),quest) ); //!< Inserting the quest.
     88
     89        if(result.second) //!< If inserting was a success.
    7490        {
    7591            COUT(3) << "Quest with questId {" << quest->getId() << "} successfully inserted." << std::endl;
     
    86102    @brief
    87103        Registers a QuestHint with the QuestManager to make it globally accessable.
     104        Uses it's id to make sure to be able to be identify and retrieve it later.
    88105    @param hint
    89106        The QuestHint to be registered.
     
    93110    bool QuestManager::registerHint(QuestHint* hint)
    94111    {
    95         if(hint == NULL)
     112        if(hint == NULL) //!< Still not liking NULL-pointers.
    96113        {
    97114            COUT(2) << "Registration of QuestHint in QuestManager failed, because inserted QuestHint-pointer was NULL." << std::endl;
     
    99116        }
    100117
    101         std::pair<std::map<std::string, QuestHint*>::iterator,bool> ret;
    102         ret = hintMap_.insert ( std::pair<std::string,QuestHint*>(hint->getId(),hint) );
    103 
    104         if(ret.second)
     118        std::pair<std::map<std::string, QuestHint*>::iterator,bool> result;
     119        result = hintMap_s.insert ( std::pair<std::string,QuestHint*>(hint->getId(),hint) ); //!< Inserting the hint.
     120
     121        if(result.second) //!< If inserting was a success.
    105122        {
    106123            COUT(3) << "QuestHint with hintId {" << hint->getId() << "} successfully inserted." << std::endl;
     
    127144    Quest* QuestManager::findQuest(const std::string & questId)
    128145    {
    129         if(!QuestItem::isId(questId))
     146        if(!QuestItem::isId(questId)) //!< Check vor validity of the given id.
    130147        {
    131148            ThrowException(Argument, "Invalid questId.");
     
    133150
    134151        Quest* quest;
    135         std::map<std::string, Quest*>::iterator it = questMap_.find(questId);
    136         if (it != questMap_.end())
     152        std::map<std::string, Quest*>::iterator it = questMap_s.find(questId);
     153        if (it != questMap_s.end()) //!< If the quest is registered.
    137154        {
    138155            quest = it->second;
     
    161178    QuestHint* QuestManager::findHint(const std::string & hintId)
    162179    {
    163         if(!QuestItem::isId(hintId))
     180        if(!QuestItem::isId(hintId)) //!< Check vor validity of the given id.
    164181        {
    165182            ThrowException(Argument, "Invalid hintId.");
     
    167184
    168185        QuestHint* hint;
    169         std::map<std::string, QuestHint*>::iterator it = hintMap_.find(hintId);
    170         if (it != hintMap_.end())
     186        std::map<std::string, QuestHint*>::iterator it = hintMap_s.find(hintId);
     187        if (it != hintMap_s.end()) //!< If the hint is registered.
    171188        {
    172189            hint = it->second;
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestManager.h

    r2096 r2159  
    2727 */
    2828
     29/**
     30    @file QuestManager.h
     31    @brief
     32        Definition of the QuestManager class.
     33*/
     34
    2935#ifndef _QuestManager_H__
    3036#define _QuestManager_H__
     
    4147    /**
    4248    @brief
    43         Manages quests, by making them globally accessable.
    44         Quests (and Hints) are registered in the QuestManager trough their id, and can be accessed in the same way.
     49        Is a static class and manages quests, by registering every quest/hint (through registerX()) and making them globally accessable (through findX()).
     50        Quests (and Hints) are registered in the QuestManager with their id, and can be accessed in the same way.
    4551    @author
    4652        Damian 'Mozork' Frick
     
    6066
    6167        private:
    62             static std::map<std::string, Quest*> questMap_; //!< All quests registered by their id's.
    63             static std::map<std::string, QuestHint*> hintMap_; //!< All hints registered by their id's.
     68            static std::map<std::string, Quest*> questMap_s; //!< All quests registered by their id's.
     69            static std::map<std::string, QuestHint*> hintMap_s; //!< All hints registered by their id's.
    6470
    6571    };
  • code/branches/questsystem2/src/orxonox/objects/quest/Rewardable.cc

    r2105 r2159  
    2727 */
    2828
     29/**
     30    @file Rewardable.cc
     31    @brief
     32        Implementation of the Rewardable class.
     33*/
     34
    2935#include "OrxonoxStableHeaders.h"
    3036#include "Rewardable.h"
     
    3440namespace orxonox {
    3541
    36 
     42    /**
     43    @brief
     44        Constructor. Registers the object.
     45    */
    3746    Rewardable::Rewardable(BaseObject* creator) : BaseObject(creator)
    3847    {
     
    4049    }
    4150
    42 
     51    /**
     52    @brief
     53        Destructor,
     54    */
    4355    Rewardable::~Rewardable()
    4456    {
  • code/branches/questsystem2/src/orxonox/objects/quest/Rewardable.h

    r2146 r2159  
    2727 */
    2828
     29/**
     30    @file Rewardable.h
     31    @brief
     32        Definition of the Rewardable class.
     33*/
     34
    2935#ifndef _Rewardable_H__
    3036#define _Rewardable_H__
     
    3844    /**
    3945    @brief
    40         Rewardable is an Interface, that can be implemented by any object to enable it to be given as reward to a player through QuestEffects.
     46        Rewardable is an Interface, that can be implemented by any object to enable it to be given as reward to a player through QuestEffects. (With the AddReward effect.)
     47       
     48        It just needs to inherit form Rewardable, and implement the reward() method.
    4149    @author
    4250        Damian 'Mozork' Frick
     
    4957            virtual ~Rewardable();
    5058
    51             virtual bool reward(ControllableEntity* player) = 0; //!<Method to transcribe a rewardable object to the player.
     59            /**
     60            @brief
     61                Method to transcribe a rewardable object to the player.
     62                Must be implemented by every class inheriting from Rewardable.
     63            @param player
     64                A pointer to the ControllableEntity, do whatever you want with it.
     65            @return
     66                Return true if successful.
     67            */
     68            virtual bool reward(ControllableEntity* player) = 0; //!<
    5269
    5370    };
Note: See TracChangeset for help on using the changeset viewer.