Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 15, 2010, 7:29:16 PM (14 years ago)
Author:
dafrick
Message:

Reviewing documentation fo Questsystem, moving documentation fully into doxygen.
Added some files to modules they belong to.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/questsystem/QuestManager.cc

    r7284 r7456  
    2828
    2929/**
    30     @file
     30    @file QuestManager.cc
    3131    @brief Implementation of the QuestManager class.
    3232*/
     
    3434#include "QuestManager.h"
    3535
    36 #include <CEGUIWindow.h>
    37 
    3836#include "util/Exception.h"
    3937#include "util/ScopedSingletonManager.h"
     38#include "core/command/ConsoleCommand.h"
    4039#include "core/CoreIncludes.h"
    4140#include "core/GUIManager.h"
    4241#include "core/LuaState.h"
    43 #include "core/command/ConsoleCommand.h"
     42
    4443#include "infos/PlayerInfo.h"
    45 #include "overlays/GUIOverlay.h"
    46 
    47 #include "ToluaBindQuestsystem.h"
     44
    4845#include "Quest.h"
    4946#include "QuestHint.h"
    5047#include "QuestItem.h"
     48
     49#include "ToluaBindQuestsystem.h"
    5150
    5251namespace orxonox
     
    6665    {
    6766        RegisterRootObject(QuestManager);
     67
     68        COUT(3) << "QuestManager created." << std::endl;
    6869    }
    6970
     
    7475    QuestManager::~QuestManager()
    7576    {
    76 
     77        COUT(3) << "QuestManager destroyed." << std::endl;
    7778    }
    7879
     
    99100    bool QuestManager::registerQuest(Quest* quest)
    100101    {
    101         if(quest == NULL) //!< Doh! Just as if there were actual quests behind NULL-pointers.
     102        //TODO: Replace with assert.
     103        if(quest == NULL) // Doh! Just as if there were actual quests behind NULL-pointers.
    102104        {
    103105            COUT(2) << "Registration of Quest in QuestManager failed, because inserted Quest-pointer was NULL." << std::endl;
     
    106108
    107109        std::pair<std::map<std::string, Quest*>::iterator,bool> result;
    108         result = this->questMap_.insert( std::pair<std::string,Quest*>(quest->getId(),quest) ); //!< Inserting the Quest.
    109 
    110         if(result.second) //!< If inserting was a success.
     110        result = this->questMap_.insert( std::pair<std::string,Quest*>(quest->getId(),quest) ); // Inserting the Quest.
     111
     112        if(result.second) // If inserting was a success.
    111113        {
    112114            quest->setRegistered();
     
    141143    bool QuestManager::registerHint(QuestHint* hint)
    142144    {
    143         if(hint == NULL) //!< Still not liking NULL-pointers.
     145        //TODO: Replace with assert.
     146        if(hint == NULL) // Still not liking NULL-pointers.
    144147        {
    145148            COUT(2) << "Registration of QuestHint in QuestManager failed, because inserted QuestHint-pointer was NULL." << std::endl;
     
    148151
    149152        std::pair<std::map<std::string, QuestHint*>::iterator,bool> result;
    150         result = this->hintMap_.insert ( std::pair<std::string,QuestHint*>(hint->getId(),hint) ); //!< Inserting the QuestHSint.
    151 
    152         if(result.second) //!< If inserting was a success.
     153        result = this->hintMap_.insert ( std::pair<std::string,QuestHint*>(hint->getId(),hint) ); // Inserting the QuestHSint.
     154
     155        if(result.second) // If inserting was a success.
    153156        {
    154157            hint->setRegistered();
     
    185188    Quest* QuestManager::findQuest(const std::string & questId)
    186189    {
    187         if(questId.compare(BLANKSTRING) == 1) //!< Check vor validity of the given id.
    188         {
     190        if(questId.compare(BLANKSTRING) == 1) // Check vor validity of the given id.
    189191            ThrowException(Argument, "Invalid questId.");
    190         }
    191192
    192193        Quest* quest;
    193194        std::map<std::string, Quest*>::iterator it = this->questMap_.find(questId);
    194         if (it != this->questMap_.end()) //!< If the Quest is registered.
    195         {
     195        if (it != this->questMap_.end()) // If the Quest is registered.
    196196            quest = it->second;
    197         }
    198197        else
    199198        {
     
    203202
    204203        return quest;
    205 
    206204    }
    207205
     
    219217    QuestHint* QuestManager::findHint(const std::string & hintId)
    220218    {
    221         if(hintId.compare(BLANKSTRING) == 1) //!< Check vor validity of the given id.
    222         {
     219        if(hintId.compare(BLANKSTRING) == 1) // Check vor validity of the given id.
    223220            ThrowException(Argument, "Invalid hintId.");
    224         }
    225221
    226222        QuestHint* hint;
    227223        std::map<std::string, QuestHint*>::iterator it = this->hintMap_.find(hintId);
    228         if (it != this->hintMap_.end()) //!< If the QuestHint is registered.
    229         {
     224        if (it != this->hintMap_.end()) // If the QuestHint is registered.
    230225            hint = it->second;
    231         }
    232226        else
    233227        {
     
    237231
    238232        return hint;
    239 
    240     }
    241 
    242     int QuestManager::getNumParentQuests(PlayerInfo* player)
     233    }
     234
     235    /**
     236    @brief
     237        Get the number of Quests the input player has, that are root quests.
     238    @param player
     239        The player.
     240    @return
     241        Returns the number of Quests the input player has, that are root quests.
     242    */
     243    int QuestManager::getNumRootQuests(PlayerInfo* player)
    243244    {
    244245        int numQuests = 0;
     
    251252    }
    252253
    253     Quest* QuestManager::getParentQuest(PlayerInfo* player, int index)
     254    /**
     255    @brief
     256        Get the index-th root quest of the input player.
     257    @param player
     258        The player.
     259    @param index
     260        The index of the root quest.
     261    @return
     262        Returns the index-th root quest of the input player.
     263    */
     264    Quest* QuestManager::getRootQuest(PlayerInfo* player, int index)
    254265    {
    255266        for(std::map<std::string, Quest*>::iterator it = this->questMap_.begin(); it != this->questMap_.end(); it++)
     
    261272    }
    262273
     274    /**
     275    @brief
     276        Get the number of sub-quest of an input Quest for the input player.
     277    @param quest
     278        The quest to get the sub-quests of.
     279    @param player
     280        The player.
     281    @return
     282        Returns the number of sub-quest of an input Quest for the input player.
     283    */
    263284    int QuestManager::getNumSubQuests(Quest* quest, PlayerInfo* player)
    264285    {
     
    273294    }
    274295
     296    /**
     297    @brief
     298        Get the index-th sub-quest of the input Quest for the input player.
     299    @param quest
     300        The Quest to get the sub-quest of.
     301    @param player
     302        The player.
     303    @param index
     304        The index of the sub-quest.
     305    */
    275306    Quest* QuestManager::getSubQuest(Quest* quest, PlayerInfo* player, int index)
    276307    {
     
    284315    }
    285316
     317    /**
     318    @brief
     319        Get the number of QuestHints of the input Quest for the input player.
     320    @param quest
     321        The quest to get the hints of.
     322    @param player
     323        The player.
     324    @return Returns the number of QuestHints of the input Quest for the input player.
     325    */
    286326    int QuestManager::getNumHints(Quest* quest, PlayerInfo* player)
    287327    {
     
    296336    }
    297337
     338    /**
     339    @brief
     340        Get the index-th QuestHint of the input Quest for the input player.
     341    @param quest
     342        The Quest to get the QuestHint of.
     343    @param player
     344        The player.
     345    @param index
     346        The index of the QuestHint.
     347    */
    298348    QuestHint* QuestManager::getHints(Quest* quest, PlayerInfo* player, int index)
    299349    {
     
    307357    }
    308358
     359    /**
     360    @brief
     361        Get the QuestDescription of the input Quest.
     362    @param item
     363        The Quest to get the QuestDescription of.
     364    @return
     365        Return a pointer ot the QuestDescription of the input Quest.
     366    */
    309367    QuestDescription* QuestManager::getDescription(Quest* item)
    310368    {
     
    312370    }
    313371
     372    /**
     373    @brief
     374        Get the QuestDescription of the input QuestHint.
     375    @param item
     376        The QuestHint to get the QuestDescription of.
     377    @return
     378        Returns a pointer to the QuestDescription of the input QuestHint.
     379    */
    314380    QuestDescription* QuestManager::getDescription(QuestHint* item)
    315381    {
Note: See TracChangeset for help on using the changeset viewer.