Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Just changed some small stuff…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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    };
Note: See TracChangeset for help on using the changeset viewer.