Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 3, 2008, 4:40:00 PM (17 years ago)
Author:
dafrick
Message:
  • Created QuestListeners, they can be used to affect Objects due to status changes of quests.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem3/src/orxonox/objects/quest/QuestDescription.h

    r2261 r2328  
    5252        Creating a QuestDescription through XML goes as follows:
    5353       
    54         <QuestDescription title="Title" description="Description Text" />
     54        <QuestDescription title="Title" description="Description Text" failMessage="You fail." completeMessage="You win!" />
    5555    @author
    5656        Damian 'Mozork' Frick
     
    6464            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestDescription object through XML.
    6565
    66         /**
    67         @brief Returns the title.
    68         @return Returns a string containing the title of the QuestDescription.
    69         */
    70             inline const std::string & getTitle(void) const
    71                 { return this->title_; }
    72        
    73         /**
    74         @brief Returns the description text.
    75         @return Returns a string containing the description text of the QuestDescription.
    76         */
    77             inline const std::string & getDescription(void) const
    78                 { return this->description_; }
     66            /**
     67            @brief Returns the title.
     68            @return Returns a string containing the title of the QuestDescription.
     69            */
     70            inline const std::string & getTitle(void) const
     71                { return this->title_; }
     72           
     73            /**
     74            @brief Returns the description text.
     75            @return Returns a string containing the description text of the QuestDescription.
     76            */
     77            inline const std::string & getDescription(void) const
     78                { return this->description_; }
     79               
     80            /**
     81            @brief Returns the fail message.
     82            @return Returns a string containing the fail message of the QuestDescription.
     83            */
     84            inline const std::string & getFailMessage(void) const
     85                { return this->failMessage_; }
     86               
     87            /**
     88            @brief Returns the complete message.
     89            @return Returns a string containing the complete message of the QuestDescription.
     90            */
     91            inline const std::string & getCompleteMessage(void) const
     92                { return this->completeMessage_; }
    7993
    8094        private:
    8195            std::string title_; //!< The title.
    8296            std::string description_; //!< The description.
     97            std::string failMessage_; //!< The message displayed when the Quest is failed.
     98            std::string completeMessage_; //!< The message displayed when the Quest is completed.
    8399
    84100            /**
     
    89105                { this->title_ = title; }
    90106               
    91         /**
     107            /**
    92108            @brief Sets the description text.
    93109            @param description The description text to be set.
     
    96112                { this->description_ = description; }
    97113
     114            /**
     115            @brief Sets the fail message.
     116            @param message The fail message to be set.
     117            */
     118            inline void setFailMessage(const std::string & message)
     119                { this->failMessage_ = message; }
     120               
     121            /**
     122            @brief Sets the complete message.
     123            @param message The complete message to be set.
     124            */
     125            inline void setCompleteMessage(const std::string & message)
     126                { this->completeMessage_ = message; }
     127
    98128    };
    99129
Note: See TracChangeset for help on using the changeset viewer.