Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2191


Ignore:
Timestamp:
Nov 12, 2008, 1:29:33 PM (16 years ago)
Author:
dafrick
Message:

Just changed some small stuff…

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

Legend:

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

    r2159 r2191  
    5151    /**
    5252    @brief
    53         Constructor. Registers the quest.
     53        Constructor. Registers the object.
    5454    */
    5555    AddQuest::AddQuest(BaseObject* creator) : ChangeQuestStatus(creator)
     
    7878    /**
    7979    @brief
    80         Invokes the effect.
     80        Invokes the QuestEffect.
    8181    @param player
    82         The player the effect is invoked on.
     82        The player the QuestEffect is invoked on.
    8383    @return
    84         Returns true if the effect was successfully invoked.
     84        Returns true if the QuestEffect was successfully invoked.
    8585    */
    8686    bool AddQuest::invoke(ControllableEntity* player)
  • code/branches/questsystem2/src/orxonox/objects/quest/AddQuest.h

    r2159 r2191  
    4747    /**
    4848    @brief
    49         Adds a quest, resp. changes the quests status to active for the player invoking the quest.
     49        Adds a Quest, resp. changes the quests status to active for the player invoking the Quest.
    5050    @author
    5151        Damian 'Mozork' Frick
     
    5959            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddQuest object through XML.
    6060
    61             virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.
     61            virtual bool invoke(ControllableEntity* player); //!< Invokes the QuestEffect.
    6262
    6363    };
  • code/branches/questsystem2/src/orxonox/objects/quest/AddQuestHint.cc

    r2159 r2191  
    7979    /**
    8080    @brief
    81         Sets the id of the quest hint to be added to the player the effect is invoked on.
     81        Sets the id of the QuestHint to be added to the player the QuestEffect is invoked on.
    8282    @param id
    8383        The QuestHint id.
     
    8585        Returns true if successful.
    8686    */
    87     inline void AddQuestHint::setHintId(const std::string & id)
     87    bool AddQuestHint::setHintId(const std::string & id)
    8888    {
    8989        if(!QuestItem::isId(id))
     
    9999    /**
    100100    @brief
    101         Invokes the effect.
     101        Invokes the QuestEffect.
    102102    @param player
    103103        The player.
    104104    @return
    105         Returns true if the effect was successfully invoked.
     105        Returns true if the QuestEffect was successfully invoked.
    106106    */
    107107    bool AddQuestHint::invoke(ControllableEntity* player)
  • code/branches/questsystem2/src/orxonox/objects/quest/AddQuestHint.h

    r2159 r2191  
    4646    /**
    4747    @brief
    48         Adds a QuestHint, resp. activates the QuestHint of the given id for the player the effect is invoked on.
     48        Adds a QuestHint, resp. activates the QuestHint of the given id for the player the QuestEffect is invoked on.
    4949    @author
    5050        Damian 'Mozork' Frick
     
    5858            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddQuestHint object through XML.
    5959
    60             virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.
     60            virtual bool invoke(ControllableEntity* player); //!< Invokes the QuestEffect.
    6161
    6262        private:
    6363            std::string hintId_; //!< The id of the QuestHint.
    6464
    65             inline const std::string & getHintId(void) const //!< Returns the if of the hint.
     65            /**
     66            @brief Returns the id of the QuestHint.
     67            @return Returns the id of the QuestHint.
     68            */
     69            inline const std::string & getHintId(void) const
    6670                { return this->hintId_; }
    67             void setHintId(const std::string & id); //!< Sets the id of the hint.
     71            bool setHintId(const std::string & id); //!< Sets the id of the QuestHint.
    6872
    6973    };
  • code/branches/questsystem2/src/orxonox/objects/quest/AddReward.cc

    r2159 r2191  
    7575    /**
    7676    @brief
    77         Returns the rewardbale object at the given index.
     77        Returns the Rewardable object at the given index.
    7878    @param index
    7979        The index.
    8080    @return
    81         Returns a pointer to the rewardable object at the given index.
     81        Returns a pointer to the Rewardable object at the given index.
    8282    */
    8383    const Rewardable* AddReward::getRewardables(unsigned int index) const
     
    9797    /**
    9898    @brief
    99         Invokes the effect.
     99        Invokes the QuestEffect.
    100100    @param player
    101101        The player.
    102102    @return
    103         Returns true if the effect was invoked successfully.
     103        Returns true if the QuestEffect was invoked successfully.
    104104    */
    105105    bool AddReward::invoke(ControllableEntity* player)
  • code/branches/questsystem2/src/orxonox/objects/quest/AddReward.h

    r2159 r2191  
    4747    /**
    4848    @brief
    49         Adds a list of rewards to a player.
     49        Adds a list of Rewardables to a player.
    5050    @author
    5151        Damian 'Mozork' Frick
     
    5959            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddReward object through XML.
    6060
    61             virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.
     61            virtual bool invoke(ControllableEntity* player); //!< Invokes the QuestEffect.
    6262
    6363        private:
    64             std::list<Rewardable*> rewards_; //!< A list of rewards to be added to the player invoking the effect.
     64            std::list<Rewardable*> rewards_; //!< A list of Rewardables to be added to the player invoking the QuestEffect.
    6565
    66             inline void addRewardable(Rewardable* reward) //!< Add a rewardable object to the list of objects to be awarded to the player invoking the effect.
     66            /**
     67            @brief Add a Rewardable object to the list of objects to be awarded to the player invoking the QuestEffect.
     68            @param reward Pointer to the Rewardable to be added.
     69            */
     70            inline void addRewardable(Rewardable* reward)
    6771                { this->rewards_.push_back(reward); }
    68             const Rewardable* getRewardables(unsigned int index) const; //!< Returns the rewardable object at the given index.
     72            const Rewardable* getRewardables(unsigned int index) const; //!< Returns the Rewardable object at the given index.
    6973
    7074    };
  • code/branches/questsystem2/src/orxonox/objects/quest/ChangeQuestStatus.cc

    r2159 r2191  
    6161    /**
    6262    @brief
    63         Sets the id of the quest the effect chagnes the status of.
     63        Sets the id of the Quest the Questffect changes the status of.
    6464    @param id
    65         The id of the quest.
     65        The id of the Quest.
    6666    @return
    6767        Returns true if successful.
  • code/branches/questsystem2/src/orxonox/objects/quest/ChangeQuestStatus.h

    r2159 r2191  
    4747    /**
    4848    @brief
    49         An effect which changes a quests status of a specified quest for the player invoking the effect.
     49        A QuestEffect which changes the status of a specified Quest for the player invoking the QuestEffect.
    5050    @author
    5151        Damian 'Mozork' Frick
     
    5959            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a ChangeQuestStatus object through XML.
    6060
    61             virtual bool invoke(ControllableEntity* player) = 0; //!< Invokes the effect.
     61            virtual bool invoke(ControllableEntity* player) = 0; //!< Invokes the QuestEffect.
    6262
    6363        protected:
    64             inline const std::string & getQuestId(void) const //!< Returns the quest id.
     64            /**
     65                @brief Returns the id of the Quest.
     66                @return Returns the id of the Quest.
     67            */
     68            inline const std::string & getQuestId(void) const
    6569                { return this->questId_; }
    6670
    6771        private:
    68             std::string questId_; //!< The id of the quest the status should be changed of.
     72            std::string questId_; //!< The id of the Quest the status should be changed of.
    6973           
    70             void setQuestId(const std::string & id); //!< Sets the quest id.
     74            bool setQuestId(const std::string & id); //!< Sets the id of the Quest.
    7175
    7276    };
  • code/branches/questsystem2/src/orxonox/objects/quest/CompleteQuest.cc

    r2159 r2191  
    7575    /**
    7676    @brief
    77         Invokes the effect.
     77        Invokes the QuestEffect.
    7878    @param player
    79         The player the effect is invoked on.
     79        The player the QuestEffect is invoked on.
    8080    @return
    81         Returns true if the effect was invoked successfully.
     81        Returns true if the QuestEffect was invoked successfully.
    8282    */
    8383    bool CompleteQuest::invoke(ControllableEntity* player)
  • code/branches/questsystem2/src/orxonox/objects/quest/CompleteQuest.h

    r2159 r2191  
    4747    /**
    4848    @brief
    49         Completes a quest (with a specified id) for the player invoking the effect.
     49        Completes a Quest (with a specified id) for the player invoking the QuestEffect.
    5050    @author
    5151        Damian 'Mozork' Frick
     
    5959            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a CompleteQuest object through XML.
    6060
    61             virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.
     61            virtual bool invoke(ControllableEntity* player); //!< Invokes the QuestEffect.
    6262
    6363    };
  • code/branches/questsystem2/src/orxonox/objects/quest/FailQuest.cc

    r2159 r2191  
    7575    /**
    7676    @brief
    77         Invokes the effect.
     77        Invokes the QuestEffect.
    7878    @param player
    79         The player the effect is invoked on.
     79        The player the QuestEffect is invoked on.
    8080    @return
    81         Returns true if the effect was invoked successfully.
     81        Returns true if the QuestEffect was invoked successfully.
    8282    */
    8383    bool FailQuest::invoke(ControllableEntity* player)
  • code/branches/questsystem2/src/orxonox/objects/quest/FailQuest.h

    r2159 r2191  
    5959            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a FailQuest object through XML.
    6060
    61             virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.
     61            virtual bool invoke(ControllableEntity* player); //!< Invokes the QuestEffect.
    6262
    6363    };
  • code/branches/questsystem2/src/orxonox/objects/quest/GlobalQuest.cc

    r2159 r2191  
    7979    /**
    8080    @brief
    81         Fails the quest for all players.
    82         Invokes the failEffects on all the players possessing this quest.
     81        Fails the Quest for all players.
     82        Invokes the fail QuestEffects on all the players possessing this Quest.
    8383    @param player
    8484        The player failing it.
    8585    @return
    86         Returns true if the quest could be failed, false if not.
     86        Returns true if the Quest could be failed, false if not.
    8787    */
    8888    bool GlobalQuest::fail(ControllableEntity* player)
    8989    {
    90         if(this->isFailable(player)) //!< Check whether the quest can be failed.
     90        if(this->isFailable(player)) //!< Check whether the Quest can be failed.
    9191        {
    9292            this->setStatus(player, questStatus::failed);
    9393           
    94             //! Iterate through all players possessing this quest.
     94            //! Iterate through all players possessing this Quest.
    9595            for(std::set<ControllableEntity*>::const_iterator it = players_.begin(); it != players_.end(); it++)
    9696            {
     
    107107    /**
    108108    @brief
    109         Completes the quest for all players.
    110         Invokes the completeEffects on all the players possessing this quest.
    111         Invokes the reward effects on the player completing the quest.
     109        Completes the Quest for all players.
     110        Invokes the complete QuestEffects on all the players possessing this Quest.
     111        Invokes the reward QuestEffects on the player completing the Quest.
    112112    @param player
    113113        The player completing it.
    114114    @return
    115         Returns true if the quest could be completed, false if not.
     115        Returns true if the Quest could be completed, false if not.
    116116    */
    117117    bool GlobalQuest::complete(ControllableEntity* player)
    118118    {
    119         if(this->isCompletable(player)) //!< Check whether the quest can be completed.
     119        if(this->isCompletable(player)) //!< Check whether the Quest can be completed.
    120120        {
    121121            this->setStatus(player, questStatus::completed);
    122122           
    123             //! Iterate through all players possessing the quest.
     123            //! Iterate through all players possessing the Quest.
    124124            for(std::set<ControllableEntity*>::const_iterator it = players_.begin(); it != players_.end(); it++)
    125125            {
     
    127127            }
    128128           
    129             QuestEffect::invokeEffects(player, this->rewards_); //!< Invoke reward effects on the player completing the quest.
     129            QuestEffect::invokeEffects(player, this->rewards_); //!< Invoke reward QuestEffects on the player completing the Quest.
    130130            return true;
    131131        }
     
    137137    /**
    138138    @brief
    139         Checks whether the quest can be started.
     139        Checks whether the Quest can be started.
    140140    @param player
    141141        The player for whom is to be checked.
     
    152152    /**
    153153    @brief
    154         Checks whether the quest can be failed.
     154        Checks whether the Quest can be failed.
    155155    @param player
    156156        The player for whom is to be checked.
    157157    @return
    158         Returns true if the quest can be failed, false if not.
     158        Returns true if the Quest can be failed, false if not.
    159159    @throws
    160160        Throws an Exception if isActive() throws one.
     
    168168    /**
    169169    @brief
    170         Checks whether the quest can be completed.
     170        Checks whether the Quest can be completed.
    171171    @param player
    172172        The player for whom is to be checked.
    173173    @return
    174         Returns true if the quest can be completed, false if not.
     174        Returns true if the Quest can be completed, false if not.
    175175    @throws
    176176        Throws an Exception if isActive() throws one.
     
    183183    /**
    184184    @brief
    185         Returns the status of the quest for a specific player.
     185        Returns the status of the Quest for a specific player.
    186186    @param player
    187187        The player.
     
    237237    /**
    238238    @brief
    239         Adds a reward effect to the list of reward effects.
     239        Adds a reward QuestEffect to the list of reward QuestEffects.
    240240    @param effect
    241         The effect to be added.
     241        The QuestEffect to be added.
    242242    @return
    243243        Returns true if successful.
     
    251251        }
    252252
    253         this->rewards_.push_back(effect); //!< Add the effect to the list.
     253        this->rewards_.push_back(effect); //!< Add the QuestEffect to the list.
    254254
    255255        COUT(3) << "Reward effect was added to Quest {" << this->getId() << "}." << std::endl;
     
    259259    /**
    260260    @brief
    261         Returns the reward effect at the given index.
     261        Returns the reward QuestEffect at the given index.
    262262    @param index
    263263        The index.
  • code/branches/questsystem2/src/orxonox/objects/quest/GlobalQuest.h

    r2159 r2191  
    4848    /**
    4949    @brief
    50         Global quests are quests, that have the same status for all players.
     50        GlobalQuests are Quests, that have the same status for all players.
    5151        This means, that when a player successfully completes a GlobalQuest, it is completed for all players that have it.
    5252       
     
    9292            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a GlobalQuest object through XML.
    9393           
    94             virtual bool fail(ControllableEntity* player); //!< Fails the quest.
    95             virtual bool complete(ControllableEntity* player); //!< Completes the quest.
     94            virtual bool fail(ControllableEntity* player); //!< Fails the Quest.
     95            virtual bool complete(ControllableEntity* player); //!< Completes the Quest.
    9696
    9797        protected:
    98             virtual bool isStartable(const ControllableEntity* player) const; //!< Checks whether the quest can be started.
    99             virtual bool isFailable(const ControllableEntity* player) const; //!< Checks whether the quest can be failed.
    100             virtual bool isCompletable(const ControllableEntity* player) const; //!< Checks whether the quest can be completed.
     98            virtual bool isStartable(const ControllableEntity* player) const; //!< Checks whether the Quest can be started.
     99            virtual bool isFailable(const ControllableEntity* player) const; //!< Checks whether the Quest can be failed.
     100            virtual bool isCompletable(const ControllableEntity* player) const; //!< Checks whether the Quest can be completed.
    101101
    102             virtual questStatus::Enum getStatus(const ControllableEntity* player) const; //!< Returns the status of the quest for a specific player.
     102            virtual questStatus::Enum getStatus(const ControllableEntity* player) const; //!< Returns the status of the Quest for a specific player.
    103103            virtual bool setStatus(ControllableEntity* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
    104104
    105105        private:
    106             std::set<ControllableEntity*> players_; //!< The set of players which possess this quest.
    107             questStatus::Enum status_; //!< The status of this quest.
    108             std::list<QuestEffect*> rewards_; //!< Reward effects only invoked on the player completing the quest.
     106            std::set<ControllableEntity*> players_; //!< The set of players which possess this Quest.
     107            questStatus::Enum status_; //!< The status of this Quest.
     108            std::list<QuestEffect*> rewards_; //!< Reward QuestEffects only invoked on the player completing the Quest.
    109109           
    110             bool addRewardEffect(QuestEffect* effect); //!< Adds a reward effect to the list of reward effects.
    111             const QuestEffect* getRewardEffects(unsigned int index) const; //!< Returns the reward effect at the given index.
     110            bool addRewardEffect(QuestEffect* effect); //!< Adds a reward QuestEffect to the list of reward QuestEffects.
     111            const QuestEffect* getRewardEffects(unsigned int index) const; //!< Returns the reward QuestEffect at the given index.
    112112
    113113    };
  • code/branches/questsystem2/src/orxonox/objects/quest/LocalQuest.cc

    r2159 r2191  
    7777    /**
    7878    @brief
    79         Fails the quest for a given player.
     79        Fails the Quest for a given player.
    8080        Invokes all the failEffects on the player.
    8181    @param player
    8282        The player.
    8383    @return
    84         Returns true if the quest could be failed, false if not.
     84        Returns true if the Quest could be failed, false if not.
    8585    */
    8686    bool LocalQuest::fail(ControllableEntity* player)
     
    9999    /**
    100100    @brief
    101         Completes the quest for a given player.
    102         Invokes all the completeEffects on the player.
     101        Completes the Quest for a given player.
     102        Invokes all the complete QuestEffects on the player.
    103103    @param player
    104104        The player.
    105105    @return
    106         Returns true if the quest could be completed, false if not.
     106        Returns true if the Quest could be completed, false if not.
    107107    */
    108108    bool LocalQuest::complete(ControllableEntity* player)
    109109    {
    110         if(this->isCompletable(player)) //!< Checks whether the quest can be completed.
     110        if(this->isCompletable(player)) //!< Checks whether the Quest can be completed.
    111111        {
    112112            this->setStatus(player, questStatus::completed);
    113             QuestEffect::invokeEffects(player, this->getCompleteEffectList()); //!< Invoke the completeEffects.
     113            QuestEffect::invokeEffects(player, this->getCompleteEffectList()); //!< Invoke the complete QuestEffects.
    114114            return true;
    115115        }
     
    121121    /**
    122122    @brief
    123         Checks whether the quest can be started.
     123        Checks whether the Quest can be started.
    124124    @param player
    125125        The player for whom is to be checked.
    126126    @return
    127         Returns true if the quest can be started, false if not.
     127        Returns true if the Quest can be started, false if not.
    128128    @throws
    129129        Throws an exception if isInactive(ControllableEntity*) throws one.
     
    136136    /**
    137137    @brief
    138         Checks whether the quest can be failed.
     138        Checks whether the Quest can be failed.
    139139    @param player
    140140        The player for whom is to be checked.
    141141    @return
    142         Returns true if the quest can be failed, false if not.
     142        Returns true if the Quest can be failed, false if not.
    143143    @throws
    144144        Throws an exception if isActive(ControllableEntity*) throws one.
     
    151151    /**
    152152    @brief
    153         Checks whether the quest can be completed.
     153        Checks whether the Quest can be completed.
    154154    @param player
    155155        The player for whom is to be checked.
    156156    @return
    157         Returns true if the quest can be completed, false if not.
     157        Returns true if the Quest can be completed, false if not.
    158158    @throws
    159159        Throws an exception if isInactive(ControllableEntity*) throws one.
     
    166166    /**
    167167    @brief
    168         Returns the status of the quest for a specific player.
     168        Returns the status of the Quest for a specific player.
    169169    @param player
    170170        The player.
    171171    @return
    172         Returns the status of the quest for the input player.
     172        Returns the status of the Quest for the input player.
    173173    @throws
    174174        Throws an Exception if player is NULL.
  • code/branches/questsystem2/src/orxonox/objects/quest/LocalQuest.h

    r2159 r2191  
    4848    /**
    4949    @brief
    50         Handles quests which have different states for different players.
     50        Handles Quests which have different states for different players.
    5151        LocalQuests have (as opposed to GlobalQuests) a different state for each player, that means if for one player the status of the Quest changes it does not for all the other players which also possess this quest.
    5252       
     
    8787            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a LocalQuest object through XML.
    8888           
    89             virtual bool fail(ControllableEntity* player); //!< Fails the quest.
    90             virtual bool complete(ControllableEntity* player); //!< Completes the quest.
     89            virtual bool fail(ControllableEntity* player); //!< Fails the Quest.
     90            virtual bool complete(ControllableEntity* player); //!< Completes the Quest.
    9191
    9292        protected:
    93             virtual bool isStartable(const ControllableEntity* player) const; //!< Checks whether the quest can be started.
    94             virtual bool isFailable(const ControllableEntity* player) const; //!< Checks whether the quest can be failed.
    95             virtual bool isCompletable(const ControllableEntity* player) const; //!< Checks whether the quest can be completed.
     93            virtual bool isStartable(const ControllableEntity* player) const; //!< Checks whether the Quest can be started.
     94            virtual bool isFailable(const ControllableEntity* player) const; //!< Checks whether the Quest can be failed.
     95            virtual bool isCompletable(const ControllableEntity* player) const; //!< Checks whether the Quest can be completed.
    9696
    97             virtual questStatus::Enum getStatus(const ControllableEntity* player) const; //!< Returns the status of the quest for a specific player.
     97            virtual questStatus::Enum getStatus(const ControllableEntity* player) const; //!< Returns the status of the Quest for a specific player.
    9898            virtual bool setStatus(ControllableEntity* player, const questStatus::Enum & status); //!< Sets the status for a specific player.
    9999
  • code/branches/questsystem2/src/orxonox/objects/quest/Quest.cc

    r2159 r2191  
    8484    /**
    8585    @brief
    86         Sets the parent quest of the quest.
     86        Sets the parentquest of the Quest.
    8787    @param quest
    88         A pointer to the quest to be set as parent quest.
    89     @return
    90         Returns true if the parentQuest could be set.
     88        A pointer to the Quest to be set as parentquest.
     89    @return
     90        Returns true if the parentquest could be set.
    9191    */
    9292    bool Quest::setParentQuest(Quest* quest)
     
    106106    /**
    107107    @brief
    108         Adds a sub quest to the quest.
     108        Adds a subquest to the Quest.
    109109    @param quest
    110         A pointer to the quest to be set as sub quest.
    111     @return
    112         Returns true if the subQuest vould be set.
     110        A pointer to the Quest to be set as subquest.
     111    @return
     112        Returns true if the subquest could be set.
    113113    */
    114114    bool Quest::addSubQuest(Quest* quest)
     
    120120        }
    121121
    122         quest->setParentQuest(this); //!< Sets the current quest (this) as parent quest for the added subquest.
    123         this->subQuests_.push_back(quest); //!< Adds the quest to the end of the list of subquests.
     122        quest->setParentQuest(this); //!< Sets the currentQuest (this) as parentquest for the added subquest.
     123        this->subQuests_.push_back(quest); //!< Adds the Quest to the end of the list of subquests.
    124124
    125125        COUT(3) << "Sub Quest {" << quest->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
     
    130130    /**
    131131    @brief
    132         Adds a Hint to the list of hints
     132        Adds a QuestHint to the list of QuestHints
    133133    @param hint
    134         The hint that should be added to the list of hints.
     134        The QuestHint that should be added to the list of QuestHints.
    135135    @return
    136136        Returns true if the hint was successfully added.
     
    144144        }
    145145
    146         hint->setQuest(this); //!< Sets the current quest (this) as quest for the added hint.
    147         this->hints_.push_back(hint); //!< Adds the hint to the end of the list of hints.
     146        hint->setQuest(this); //!< Sets the current Quest (this) as Quest for the added QuestHint.
     147        this->hints_.push_back(hint); //!< Adds the QuestHint to the end of the list of QuestHints.
    148148
    149149        COUT(3) << "QuestHint {" << hint->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl;
     
    153153    /**
    154154    @brief
    155         Adds an effect to the list of failEffects.
     155        Adds an QuestEffect to the list of fail QuestEffects.
    156156    @param effect
    157157        The QuestEffect to be added.
     
    167167        }
    168168
    169         this->failEffects_.push_back(effect); //!< Adds the effect to the end of the list of failEffects.
     169        this->failEffects_.push_back(effect); //!< Adds the QuestEffect to the end of the list of fail QuestEffects.
    170170
    171171        COUT(3) << "A FailEffect was added to Quest {" << this->getId() << "}." << std::endl;
     
    175175    /**
    176176    @brief
    177         Adds an effect to the list of completeEffects.
     177        Adds an QuestEffect to the list of complete QuestEffects.
    178178    @param effect
    179179        The QuestEffect to be added.
     
    189189        }
    190190
    191         this->completeEffects_.push_back(effect); //!< Adds the effect to the end of the list of completeEffects.
     191        this->completeEffects_.push_back(effect); //!< Adds the QuestEffect to the end of the list of complete QuestEffects.
    192192
    193193        COUT(3) << "A CompleteEffect was added to Quest {" << this->getId() << "}." << std::endl;
     
    197197    /**
    198198    @brief
    199         Returns the parent quest of the quest.
    200     @return
    201         Returns the parent quest of the quest.
     199        Returns the parentquest of the Quest.
     200    @return
     201        Returns a pointer to the parentquest of the Quest.
    202202    */
    203203    const Quest* Quest::getParentQuest(void)
     
    208208    /**
    209209    @brief
    210         Returns the sub quest of the given index.
     210        Returns the subquest at the given index.
    211211    @param
    212212        The index.
    213213    @return
    214         Returns the subquest of the given index. NULL if there is no element on the given index.
     214        Returns a pointer to the subquest at the given index. NULL if there is no element at the given index.
    215215    */
    216216    const Quest* Quest::getSubQuest(unsigned int index) const
     
    233233    /**
    234234    @brief
    235         Returns the hint of the given index.
     235        Returns the QuestHint at the given index.
    236236    @param
    237237        The index.
    238238    @return
    239         Returns the hint of the given index. NULL if there is no element on the given index.
     239        Returns a pointer to the QuestHint at the given index. NULL if there is no element at the given index.
    240240    */
    241241    const QuestHint* Quest::getHint(unsigned int index) const
     
    243243        int i = index;
    244244       
    245         //! Iterate through all hints.
     245        //! Iterate through all QuestHints.
    246246        for (std::list<QuestHint*>::const_iterator hint = this->hints_.begin(); hint != this->hints_.end(); ++hint)
    247247        {
     
    257257    /**
    258258    @brief
    259         Returns the failEffect of the given index.
     259        Returns the fail QuestEffect at the given index.
    260260    @param
    261261        The index.
    262262    @return
    263         Returns the failEffect of the given index. NULL if there is no element on the given index.
     263        Returns a pointer to the fail QuestEffect at the given index. NULL if there is no element at the given index.
    264264    */
    265265    const QuestEffect* Quest::getFailEffect(unsigned int index) const
     
    267267        int i = index;
    268268       
    269         //! Iterate through all failEffects.
     269        //! Iterate through all fail QuestEffects.
    270270        for (std::list<QuestEffect*>::const_iterator effect = this->failEffects_.begin(); effect != this->failEffects_.end(); ++effect)
    271271        {
     
    281281    /**
    282282    @brief
    283         Returns the completeEffect of the given index.
     283        Returns the complete QuestEffect at the given index.
    284284    @param
    285285        The index.
    286286    @return
    287         Returns the completeEffect of the given index. NULL if there is no element on the given index.
     287        Returns a pointer to the complete QuestEffect at the given index. NULL if there is no element at the given index.
    288288    */
    289289    const QuestEffect* Quest::getCompleteEffect(unsigned int index) const
     
    291291        int i = index;
    292292       
    293         //! Iterate through all completeEffects.
     293        //! Iterate through all complete QuestEffects.
    294294        for (std::list<QuestEffect*>::const_iterator effect = this->completeEffects_.begin(); effect != this->completeEffects_.end(); ++effect)
    295295        {
     
    366366    /**
    367367    @brief
    368         Starts the quest for an input player.
    369     @param player
    370         The player.
    371     @return
    372         Returns true if the quest could be started, false if not.
     368        Starts the Quest for an input player.
     369    @param player
     370        The player.
     371    @return
     372        Returns true if the Quest could be started, false if not.
    373373    */
    374374    bool Quest::start(ControllableEntity* player)
  • code/branches/questsystem2/src/orxonox/objects/quest/Quest.h

    r2159 r2191  
    5050{
    5151
    52     //!Different states of a quest.
     52    //!Different states of a Quest.
    5353    enum Enum
    5454    {
     
    6565    /**
    6666    @brief
    67         Represents a quest in the game.
    68         A quest has a list of subquests and a parentquest (if it is not a rootquest).
    69         Each quest exists only once but it has a different status (inactive, active, failed or completed) for each player.
    70         A quest has several hints (QuestHint) that can be unlocked through QuestEffects and then display aid in solving the quest.
    71         A quest has a list of QuestEffects that are invoked when the quest is failed and also a list of effects that are invoked, when the quest is completed.
     67        Represents a Quest in the game.
     68        A Quest has a list of subquests and a parentquest (if it is not a rootquest).
     69        Each Quest exists only once but it has a different status (inactive, active, failed or completed) for each player.
     70        A Quest has several hints (QuestHint) that can be unlocked through QuestEffects and then display aid in solving the Quest.
     71        A Quest has a list of QuestEffects that are invoked when the quest is failed and also a list of QuestEffects that are invoked, when the Quest is completed.
    7272       
    7373        Quest itself should not be instantiated, if you want to create a quest either go for LocalQuest or GlobalQuest, whichever suits you needs better.
     
    8383            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a Quest object through XML.
    8484
    85             inline Quest* getParentQuest(void) const //!< Returns the parent quest of the quest.
     85            /**
     86            @brief Returns the parentquest of the Quest.
     87            @return Returns a pointer to the parentquest of the Quest.
     88            */
     89            inline Quest* getParentQuest(void) const
    8690                { return this->parentQuest_; }
    87             inline const std::list<Quest*> & getSubQuestList(void) const //!< Returns the list of sub quests.
     91               
     92            /**
     93            @brief Returns the list of subquests.
     94            @return Returns a reference to the list of subquests of the quest.
     95            */
     96            inline const std::list<Quest*> & getSubQuestList(void) const
    8897                { return this->subQuests_; }
    89             inline const std::list<QuestHint*> & getHintsList(void) const //!< Returns the list of all hints of this quest.
     98               
     99            /**
     100            @brief Returns the list of all QuestHints of this Quest.
     101            @return Returns a reference to the list of QuestHints of the Quest.
     102            */
     103            inline const std::list<QuestHint*> & getHintsList(void) const
    90104                { return this->hints_; }
    91105
     
    95109            bool isCompleted(const ControllableEntity* player) const; //!< Returns true if the quest status for the specific player is 'completed'.
    96110
    97             bool start(ControllableEntity* player); //!< Sets a quest to active.
    98             virtual bool fail(ControllableEntity* player) = 0; //!< Fails the quest.
    99             virtual bool complete(ControllableEntity* player) = 0; //!< Completes the quest.
     111            bool start(ControllableEntity* player); //!< Sets a Quest to active.
     112            virtual bool fail(ControllableEntity* player) = 0; //!< Fails the Quest.
     113            virtual bool complete(ControllableEntity* player) = 0; //!< Completes the Quest.
    100114
    101115        protected:
    102             virtual bool isStartable(const ControllableEntity* player) const = 0; //!< Checks whether the quest can be started.
    103             virtual bool isFailable(const ControllableEntity* player) const = 0; //!< Checks whether the quest can be failed.
    104             virtual bool isCompletable(const ControllableEntity* player) const = 0; //!< Checks whether the quest can be completed.
     116            virtual bool isStartable(const ControllableEntity* player) const = 0; //!< Checks whether the Quest can be started.
     117            virtual bool isFailable(const ControllableEntity* player) const = 0; //!< Checks whether the Quest can be failed.
     118            virtual bool isCompletable(const ControllableEntity* player) const = 0; //!< Checks whether the Quest can be completed.
    105119
    106             const Quest* getParentQuest(void); //!< Returns the parent quest of the quest.
    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.
     120            const Quest* getParentQuest(void); //!< Returns the parentquest of the Quest.
     121            const Quest* getSubQuest(unsigned int index) const; //!<Returns the subquest at the given index.
     122            const QuestHint* getHint(unsigned int index) const; //!< Returns the QuestHint at the given index.
     123            const QuestEffect* getFailEffect(unsigned int index) const; //!< Returns the fail QuestEffect at the given index.
     124            const QuestEffect* getCompleteEffect(unsigned int index) const; //!< Returns the complete QuestEffect at the given index.
     125           
     126            /**
     127            @brief Returns the list of fail QuestEffects.
     128            @return Returns a reference to the list of fail QuestEffects.
     129            */
     130            inline std::list<QuestEffect*> & getFailEffectList(void)
    112131                { return this->failEffects_; }
    113             inline std::list<QuestEffect*> & getCompleteEffectList(void) //!< Returns the list of completeEffects.
     132               
     133            /**
     134            @brief Returns the list of complete QuestEffects.
     135            @return Returns a reference to the list of complete QuestEffects.
     136            */
     137            inline std::list<QuestEffect*> & getCompleteEffectList(void)
    114138                { return this->completeEffects_; }
    115139
    116             virtual questStatus::Enum getStatus(const ControllableEntity* player) const = 0; //!< Returns the status of the quest for a specific player.
     140            virtual questStatus::Enum getStatus(const ControllableEntity* player) const = 0; //!< Returns the status of the Quest for a specific player.
    117141            virtual bool setStatus(ControllableEntity* player, const questStatus::Enum & status) = 0; //!< Changes the status for a specific player.
    118142           
    119143        private:
    120             Quest* parentQuest_; //!< Pointer to the parent quest.
    121             std::list<Quest*> subQuests_; //!< List of all the sub quests.
     144            Quest* parentQuest_; //!< Pointer to the parentquest.
     145            std::list<Quest*> subQuests_; //!< List of all the subquests.
    122146
    123             std::list<QuestHint*> hints_; //!< A list of all the hints tied to this quest.
     147            std::list<QuestHint*> hints_; //!< A list of all the QuestHints tied to this Quest.
    124148
    125             std::list<QuestEffect*> failEffects_; //!< A list of all effects to be invoked, when the quest has been failed.
    126             std::list<QuestEffect*> completeEffects_; //!< A list of effects to be invoked, when the quest has been completed.
     149            std::list<QuestEffect*> failEffects_; //!< A list of all QuestEffects to be invoked, when the Quest has been failed.
     150            std::list<QuestEffect*> completeEffects_; //!< A list of QuestEffects to be invoked, when the Quest has been completed.
    127151           
    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.
     152            bool setParentQuest(Quest* quest); //!< Sets the parentquest of the Quest.
     153            bool addSubQuest(Quest* quest); //!< Adds a subquest to the Quest.
     154            bool addHint(QuestHint* hint); //!< Add a QuestHint to the list of QuestHints.
     155            bool addFailEffect(QuestEffect* effect); //!< Adds an QuestEffect to the list of fail QuestEffects.
     156            bool addCompleteEffect(QuestEffect* effect); //!< Adds an QuestEffect to the list of complete QuestEffects.
    133157
    134158    };
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestDescription.h

    r2159 r2191  
    6060            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestDescription object through XML.
    6161
    62             inline const std::string & getTitle(void) const //!< Returns the title.
     62            /**
     63            @brief Returns the title.
     64            @return Returns a string containing the title of the QuestDescription.
     65            */
     66            inline const std::string & getTitle(void) const
    6367                { return this->title_; }
    64             inline const std::string & getDescription(void) const //!< Returns the description text.
     68           
     69            /**
     70            @brief Returns the description text.
     71            @return Returns a string containing the description text of the QuestDescription.
     72            */
     73            inline const std::string & getDescription(void) const
    6574                { return this->description_; }
    6675
     
    6978            std::string description_; //!< The description.
    7079
    71             inline void setTitle(const std::string & title) //!< Sets the title.
     80            /**
     81            @brief Sets the title.
     82            @param title The title to be set.
     83            */
     84            inline void setTitle(const std::string & title)
    7285                { this->title_ = title; }
    73             inline void setDescription(const std::string & description) //!< Sets the description text.
     86               
     87            /**
     88            @brief Sets the description text.
     89            @param description The description text to be set.
     90            */
     91            inline void setDescription(const std::string & description)
    7492                { this->description_ = description; }
    7593
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestEffect.cc

    r2159 r2191  
    6363    /**
    6464    @brief
    65         Static method. Invoke all effects in an effect list on a given player.
     65        Static method. Invoke all QuestEffects in an QuestEffect-list on a given player.
    6666    @param player
    67         The player the effects are invoked on.
     67        The player the QuestEffects are invoked on.
    6868    @param effects
    69         A list of all the effects to be invoked.
     69        A list of all the QuestEffects to be invoked.
    7070    @return
    7171        Returns false if there was an error, view console of log for further detail.
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestEffect.h

    r2159 r2191  
    4646    /**
    4747    @brief
    48         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.
     48        Handles QuestEffects for Quests.
     49        QuestEffects are the only way for Quests to have any sideeffects in the game world. They are also the only way for a player to gain, complete or fail Quests.
    5050    @author
    5151        Damian 'Mozork' Frick
     
    5757            virtual ~QuestEffect();
    5858
    59             virtual bool invoke(ControllableEntity* player) = 0; //!< Invokes the effect.
    60             static bool invokeEffects(ControllableEntity* player, std::list<QuestEffect*> & effects); //!< Invokes all effects in the list.
     59            virtual bool invoke(ControllableEntity* player) = 0; //!< Invokes the QuestEffect.
     60            static bool invokeEffects(ControllableEntity* player, std::list<QuestEffect*> & effects); //!< Invokes all QuestEffects in the list.
    6161
    6262
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.cc

    r2146 r2191  
    3232#include "core/CoreIncludes.h"
    3333#include "core/XMLPort.h"
     34#include "core/Event.h"
    3435
    3536#include "orxonox/objects/worldentities/ControllableEntity.h"
     37#include "orxonox/objects/worldentities/triggers/Trigger.h"
    3638#include "QuestEffect.h"
    3739
     
    4648        this->status_ = QuestEffectBeaconStatus::active;
    4749        this->times_ = -1;
     50        this->trigger_ = NULL;
    4851    }
    49 
    5052
    5153    QuestEffectBeacon::~QuestEffectBeacon()
     
    5860
    5961        XMLPortParam(QuestEffectBeacon, "times", setTimes, getTimes, xmlelement, mode);
    60         XMLPortObject(QuestEffectBeacon, QuestEffect, "", addEffect, getEffects, xmlelement, mode);
     62        XMLPortObject(QuestEffectBeacon, QuestEffect, "", addEffect, getEffect, xmlelement, mode);
     63        XMLPortObject(QuestEffectBeacon, Trigger, "", addTrigger, getTrigger, xmlelement, mode);
     64    }
     65   
     66    void processEvent(Event& event)
     67    {
     68        //TDO. Resolve pseudo code.
     69        //if(isControllableEntity(event.originator_))
     70        //{
     71        //    SetEvent(BaseObject, "activity", execute, event);
     72        //}
    6173    }
    6274   
     
    93105            return false;
    94106        }
    95         if(this->times_ == -1)
     107        if(this->getTimes() == -1)
    96108        {
    97109            return true;
     
    99111       
    100112        this->times_ = this->times_ - 1;
    101         if(this->times_ == 0)
     113        if(this->getTimes() == 0)
    102114        {
    103115            this->status_ = QuestEffectBeaconStatus::inactive;
     
    134146        this->effects_.push_back(effect);
    135147
    136         COUT(3) << "An effect was added to a QuestEffectBeacon." << std::endl;
     148        COUT(3) << "A QuestEffect was added to a QuestEffectBeacon." << std::endl;
    137149        return true;
     150    }
     151   
     152    bool QuestEffectBeacon::addTrigger(Trigger* trigger)
     153    {
     154        if(this->trigger_ != NULL)
     155        {
     156           COUT(2) << "A Trigger was trying to be added, where one was already set." << std::endl;
     157           return false;
     158        }
     159        if(trigger == NULL)
     160        {
     161            COUT(2) << "A NULL-Trigger was trying to be added." << std::endl;
     162            return false;
     163        }
     164       
     165        COUT(3) << "A Trigger was added to a QuestEffectBeacon." << std::endl;
     166        this->trigger_ = trigger;
     167        return true;
    138168    }
    139169   
     
    142172
    143173    */
    144     const QuestEffect* QuestEffectBeacon::getEffects(unsigned int index) const
     174    const QuestEffect* QuestEffectBeacon::getEffect(unsigned int index) const
    145175    {
    146176        int i = index;
     
    156186    }
    157187
     188    const Trigger* QuestEffectBeacon::getTrigger(unsigned int index) const
     189    {
     190        if(index == 0)
     191        {
     192            return this->trigger_;
     193        }
     194       
     195        return NULL;
     196    }
    158197
    159198}
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.h

    r2146 r2191  
    6161            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    6262           
     63            virtual void processEvent(Event& event);
     64           
    6365            bool execute(ControllableEntity* player);
    6466           
     
    6668           
    6769        protected:
     70            bool decrementTimes(void);
     71           
     72            inline const int & getTimes(void) const
     73                { return this->times_; }
     74
     75        private:
    6876            std::list<QuestEffect*> effects_;
    6977            int times_; //!< Number of times the beacon can be exectued.
    7078            QuestEffectBeaconStatus::Enum status_;
    71            
    72             bool decrementTimes(void);
     79            Trigger* trigger_;
    7380           
    7481            bool setTimes(const int & n);
    7582            bool addEffect(QuestEffect* effect);
     83            bool addTrigger(Trigger* trigger);
    7684           
    77             inline const int & getTimes(void) const
    78                 { return this->times_; }
    79             const QuestEffect* getEffects(unsigned int index) const;
     85            const QuestEffect* getEffect(unsigned int index) const;
     86            const Trigger* getTrigger(unsigned int index) const;
    8087   
    8188    };
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestHint.cc

    r2159 r2191  
    7878    /**
    7979    @brief
    80         Checks whether the hint is active for a specific player.
     80        Checks whether the QuestHint is active for a specific player.
    8181    @param player
    8282        The player.
     
    8484        Throws an Argument Exception if the input Player-pointer is NULL.
    8585    @return
    86         Returns true if the hint is active for the specified player.
     86        Returns true if the QuestHint is active for the specified player.
    8787    */
    8888    bool QuestHint::isActive(ControllableEntity* player)
     
    134134    /**
    135135    @brief
    136         Sets the quest the QuestHitn belongs to.
     136        Sets the Quest the QuestHint belongs to.
    137137    @param quest
    138         The quest to be set as quest the hint is attached to.
     138        The Quest to be set as Quest the QuestHint is attached to.
    139139    @return
    140140        Returns true if successful.
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestHint.h

    r2159 r2191  
    6262    @brief
    6363        Represents a hint in the game towards completing a Quest.
    64         Consists of title and description in textual form and must belong to a quest.
    65         A QuestHit has a defined status (inactive or active, where inactive is default) for each player, which means each QuestHint exists only once for all players, it doesn't belong to a player, it just has different states for each of them.
     64        Consists of title and description (which is stored in a QuestDescription object) in textual form and must belong to a quest.
     65        A QuestHint has a defined status (inactive or active, where inactive is default) for each player, which means each a QuestHint exists only once for all players, it doesn't belong to a player, it just has different states for each of them.
    6666       
    6767        Creating a QuestHint through XML goes as follows:
     
    8282            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestHint object through XML.
    8383
    84             bool isActive(ControllableEntity* player); //!< Returns true if the hint is active for the input player.
     84            bool isActive(ControllableEntity* player); //!< Returns true if the QuestHint is active for the input player.
    8585
    86             bool setActive(ControllableEntity* player); //!< Activates the hint for the input player.
    87             bool setQuest(Quest* quest); //!< Sets the quest the hint belongs to.
     86            bool setActive(ControllableEntity* player); //!< Activates the QuestHint for the input player.
     87            bool setQuest(Quest* quest); //!< Sets the Quest the QuestHint belongs to.
    8888
    89             inline Quest* getQuest(void) //!< Returns the quest the hint is attached to.
     89            /**
     90            @brief Returns the Quest the QuestHint is attached to.
     91            @return  Returns a pointer to the Quest the QuestHint is attached to.
     92            */
     93            inline Quest* getQuest(void)
    9094               { return this->quest_; }
    9195
    9296        private:
    93             Quest* quest_; //!< The quest the hint belongs to.
     97            Quest* quest_; //!< The Quest the QuestHint belongs to.
    9498            std::map<ControllableEntity*, questHintStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key.
    9599
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestItem.h

    r2159 r2191  
    5151    /**
    5252    @brief
    53         Functions as a base class for Quest classes such as Quest or QuestHint.
     53        Functions as a base class for quest classes such as Quest or QuestHint.
    5454        Has a unique identifier and a description.
    5555    @author
     
    6565            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestItem object through XML.
    6666
    67             inline const std::string & getId(void) const //!< Returns the id of this quest.
     67            /**
     68            @brief Returns the id of this QuestItem.
     69            @return Returns the id of the QuestItem.
     70            */
     71            inline const std::string & getId(void) const
    6872                { return this->id_; }
    69             inline const QuestDescription* getDescription(void) const //!< Returns the description of the QuestItem.
     73            /**
     74            @brief Returns the QuestDescription of the QuestItem.
     75            @return Returns a pointer to the QuestDescription object of the QuestItem.
     76            */
     77            inline const QuestDescription* getDescription(void) const
    7078                { return this->description_; }
    7179
     
    7482        protected:
    7583            void setId(const std::string & id); //!< Sets the id of the QuestItem.
    76             inline void setDescription(QuestDescription* description) //!< Sets the description of the QuestItem.
     84           
     85            /**
     86            @brief Sets the description of the QuestItem.
     87            @param description The QuestDescription to be set.
     88            */
     89            inline void setDescription(QuestDescription* description)
    7790                { this->description_ = description; }
    7891
    7992        private:
    8093            std::string id_; //!< Identifier. Should be of GUID form: http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure
    81             QuestDescription* description_; //!< The description of the QuestItem.
     94            QuestDescription* description_; //!< The QuestDescription of the QuestItem.
    8295
    8396    };
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestManager.cc

    r2159 r2191  
    4444namespace orxonox {
    4545
    46     //! All quests registered by their id's.
     46    //! All Quests registered by their id's.
    4747    std::map<std::string, Quest*> QuestManager::questMap_s;
    48     //! All hints registered by their id's.
     48    //! All QuestHints registered by their id's.
    4949    std::map<std::string, QuestHint*> QuestManager::hintMap_s;
    5050
     
    6969    /**
    7070    @brief
    71         Registers a quest with the QuestManager to make it globally accessable.
     71        Registers a Quest with the QuestManager to make it globally accessable.
    7272        Uses it's id to make sure to be able to be identify and retrieve it later.
    7373    @param quest
    74         The quest that is to be registered.
     74        The Quest that is to be registered.
    7575    @return
    7676        Returns true if successful, false if not.
     
    8585
    8686        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.
     87        result = questMap_s.insert( std::pair<std::string,Quest*>(quest->getId(),quest) ); //!< Inserting the Quest.
    8888
    8989        if(result.second) //!< If inserting was a success.
     
    117117
    118118        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.
     119        result = hintMap_s.insert ( std::pair<std::string,QuestHint*>(hint->getId(),hint) ); //!< Inserting the QuestHSint.
    120120
    121121        if(result.second) //!< If inserting was a success.
     
    133133    /**
    134134    @brief
    135         Finds a quest with the given id.
     135        Finds a Quest with the given id.
    136136    @param questId
    137         The id of the quest sought for.
    138     @return
    139         Returns a reference to the quest with the input id.
    140         Returns NULL if there is no quest with the given questId.
     137        The id of the Quest sought for.
     138    @return
     139        Returns a pointer to the Quest with the input id.
     140        Returns NULL if there is no Quest with the given questId.
    141141    @throws
    142142        Throws an exception if the given questId is invalid.
     
    151151        Quest* quest;
    152152        std::map<std::string, Quest*>::iterator it = questMap_s.find(questId);
    153         if (it != questMap_s.end()) //!< If the quest is registered.
     153        if (it != questMap_s.end()) //!< If the Quest is registered.
    154154        {
    155155            quest = it->second;
     
    167167    /**
    168168    @brief
    169         Finds a hint with the given id.
     169        Finds a QuestHint with the given id.
    170170    @param hintId
    171         The id of the hint sought for.
    172     @return
    173         Returns a reference to the hint with the input id.
    174         Returns NULL if there is no hint with the given hintId.
     171        The id of the QuestHint sought for.
     172    @return
     173        Returns a pointer to the QuestHint with the input id.
     174        Returns NULL if there is no QuestHint with the given hintId.
    175175    @throws
    176176        Throws an exception if the given hintId is invalid.
     
    185185        QuestHint* hint;
    186186        std::map<std::string, QuestHint*>::iterator it = hintMap_s.find(hintId);
    187         if (it != hintMap_s.end()) //!< If the hint is registered.
     187        if (it != hintMap_s.end()) //!< If the QuestHint is registered.
    188188        {
    189189            hint = it->second;
  • code/branches/questsystem2/src/orxonox/objects/quest/QuestManager.h

    r2159 r2191  
    4747    /**
    4848    @brief
    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.
     49        Is a static class and manages Quests, by registering every Quest/QuestHint (through registerX()) and making them globally accessable (through findX()).
     50        Quests (and QuestHints) are registered in the QuestManager with their id, and can be accessed in the same way.
    5151    @author
    5252        Damian 'Mozork' Frick
     
    5959            virtual ~QuestManager();
    6060
    61             static bool registerQuest(Quest* quest); //!< Registers a quest in the QuestManager.
     61            static bool registerQuest(Quest* quest); //!< Registers a Quest in the QuestManager.
    6262            static bool registerHint(QuestHint* quest); //!< Registers a QuestHint in the QuestManager.
    6363
    64             static Quest* findQuest(const std::string & questId); //!< Returns the quest with the input id.
     64            static Quest* findQuest(const std::string & questId); //!< Returns the Quest with the input id.
    6565            static QuestHint* findHint(const std::string & hintId); //!< Returns the QuestHint with the input id.
    6666
    6767        private:
    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.
     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 QuestHints registered by their id's.
    7070
    7171    };
Note: See TracChangeset for help on using the changeset viewer.