Changeset 5693 for code/trunk/src/orxonox/objects/quest/QuestListener.h
- Timestamp:
- Aug 29, 2009, 10:19:38 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/libraries (added) merged: 5612-5613,5615-5619,5621-5623,5625-5640,5642-5643,5647-5649,5665-5666,5685-5687,5692
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/quest/QuestListener.h
r3280 r5693 35 35 #define _QuestListener_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 39 39 #include <string> … … 58 58 @brief 59 59 Provides a way to react to the starting, completing and failing of Quests. 60 60 61 61 The XML representation goes as follows: 62 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 63 64 64 <BaseObject> // The object that should react to the status change of a Quest. 65 65 <events> 66 <function> // Where function is the method of the object that s chould be executed. Normally this would be visibility or activity.66 <function> // Where function is the method of the object that should be executed. Normally this would be visibility or activity. 67 67 <QuestListener questId="someQuestId" mode="someMode" /> // Where someQuestId is the identifier for the Quest the QuestListener is reacting to, and someMode is the kind of status change the QUestListener reacts to (all, start, complete or fail). 68 68 </function> … … 72 72 Damian 'Mozork' Frick 73 73 */ 74 class _ OrxonoxExport QuestListener : public BaseObject74 class _QuestExport QuestListener : public BaseObject 75 75 { 76 76 public: 77 77 QuestListener(BaseObject* creator); 78 78 virtual ~QuestListener(); 79 79 80 80 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestListener object through XML. 81 81 82 82 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. 83 83 84 84 bool setQuestId(const std::string & id); //!< Sets the questId of the Quest the QuestListener reacts to. 85 85 bool setMode(const std::string & mode); //!< Sets the mode of the QuestListener. 86 86 87 87 std::string getMode(void); //!< Get the mode of the QuestListener. 88 89 const std::string & getQuestId(void); 88 89 const std::string & getQuestId(void); 90 90 bool execute(void); //!< Executes the QuestListener, resp. fires an Event. 91 91 92 92 private: 93 93 QuestListenerMode::Value mode_; //!< The mode of the QuestListener. 94 94 Quest* quest_; //!< A pointer to the Quest the QuestListener is reacting to. 95 95 96 96 }; 97 97
Note: See TracChangeset
for help on using the changeset viewer.