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/QuestListener.h

    r7401 r7456  
    2828
    2929/**
    30     @file
     30    @file QuestListener.h
    3131    @brief Definition of the QuestListener class.
     32    @ingroup Questsystem
    3233*/
    3334
     
    4546    namespace QuestListenerMode
    4647    {
    47         //! The mode of the QuestListener.
     48        //! The mode of the @ref orxonox::QuestListener "QuestListener".
    4849        enum Value
    4950        {
     
    5758    /**
    5859    @brief
    59         Provides a way to react to the starting, completing and failing of Quests.
     60        Provides a way to react to the starting, completing and failing of @ref orxonox::Quest "Quests".
    6061
    6162        The XML representation goes as follows:
    62         You can use the QuestListener as if it were a Trigger or EventListener, that fires an Event when the status (depending on the set mode) of the given Quest changes.
    63 
    6463        @code
    6564        <BaseObject> // The object that should react to the status change of a Quest.
     
    7170        </BaseObject>
    7271        @endcode
     72
     73        You can use the QuestListener as if it were a @ref orxonox::Trigger "Trigger" or @ref orxonox::EventListener "EventListener", that fires an Event when the status (depending on the set mode) of the given @ref orxonox::Quest "Quest" changes.
    7374    @author
    7475    Damian 'Mozork' Frick
     
    7677    class _QuestsystemExport QuestListener : public BaseObject
    7778    {
    78     public:
    79         QuestListener(BaseObject* creator);
    80         virtual ~QuestListener();
    8179
    82         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestListener object through XML.
     80        public:
     81            QuestListener(BaseObject* creator);
     82            virtual ~QuestListener();
    8383
    84         static void advertiseStatusChange(std::list<QuestListener*> & listeners, const std::string & status); //!< Makes all QuestListener in the list aware that a certain status change has occured.
     84            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestListener object through XML.
    8585
    86         bool setQuestId(const std::string & id); //!< Sets the questId of the Quest the QuestListener reacts to.
    87         bool setMode(const std::string & mode); //!< Sets the mode of the QuestListener.
     86            static void advertiseStatusChange(std::list<QuestListener*> & listeners, const std::string & status); //!< Makes all QuestListener in the list aware that a certain status change has occured.
    8887
    89         std::string getMode(void); //!< Get the mode of the QuestListener.
     88            bool setQuestId(const std::string & id); //!< Sets the questId of the Quest the QuestListener reacts to.
     89            bool setMode(const std::string & mode); //!< Sets the mode of the QuestListener.
    9090
    91         const std::string & getQuestId(void);
    92         bool execute(void); //!< Executes the QuestListener, resp. fires an Event.
     91            std::string getMode(void); //!< Get the mode of the QuestListener.
    9392
    94     private:
    95         QuestListenerMode::Value mode_; //!< The mode of the QuestListener.
    96         Quest* quest_; //!< A pointer to the Quest the QuestListener is reacting to.
     93            const std::string & getQuestId(void);
     94            bool execute(void); //!< Executes the QuestListener, resp. fires an Event.
     95
     96        private:
     97            QuestListenerMode::Value mode_; //!< The mode of the QuestListener.
     98            Quest* quest_; //!< A pointer to the Quest the QuestListener is reacting to.
     99
     100            //! Static variables for the modes as strings.
     101            static const std::string ALL;
     102            static const std::string START;
     103            static const std::string FAIL;
     104            static const std::string COMPLETE;
    97105
    98106    };
Note: See TracChangeset for help on using the changeset viewer.