Changeset 7456 for code/trunk/src/modules/questsystem/QuestListener.h
- Timestamp:
- Sep 15, 2010, 7:29:16 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/questsystem/QuestListener.h
r7401 r7456 28 28 29 29 /** 30 @file 30 @file QuestListener.h 31 31 @brief Definition of the QuestListener class. 32 @ingroup Questsystem 32 33 */ 33 34 … … 45 46 namespace QuestListenerMode 46 47 { 47 //! The mode of the QuestListener.48 //! The mode of the @ref orxonox::QuestListener "QuestListener". 48 49 enum Value 49 50 { … … 57 58 /** 58 59 @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". 60 61 61 62 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 64 63 @code 65 64 <BaseObject> // The object that should react to the status change of a Quest. … … 71 70 </BaseObject> 72 71 @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. 73 74 @author 74 75 Damian 'Mozork' Frick … … 76 77 class _QuestsystemExport QuestListener : public BaseObject 77 78 { 78 public:79 QuestListener(BaseObject* creator);80 virtual ~QuestListener();81 79 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(); 83 83 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. 85 85 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. 88 87 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. 90 90 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. 93 92 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; 97 105 98 106 };
Note: See TracChangeset
for help on using the changeset viewer.