Changeset 5693 for code/trunk/src/orxonox/objects/quest/QuestEffectBeacon.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/QuestEffectBeacon.h
r3280 r5693 35 35 #define _QuestEffectBeacon_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 39 39 #include <list> … … 58 58 A QuestEffectBeacon can be executed a defined number of times. 59 59 A QuestEffectBeacon can be inactive or active. 60 60 61 61 Creating a QuestEffectBeacon through XML goes as follows: 62 62 63 63 <QuestEffectBeacon times=n> //Where 'n' is eighter a number >= 0, which means the QuestEffectBeacon can be executed n times. Or n = -1, which means the QuestEffectBeacon can be executed an infinite number of times. 64 64 <effects> … … 79 79 Damian 'Mozork' Frick 80 80 */ 81 class _ OrxonoxExport QuestEffectBeacon : public StaticEntity81 class _QuestExport QuestEffectBeacon : public StaticEntity 82 82 { 83 83 public: 84 84 QuestEffectBeacon(BaseObject* creator); 85 85 virtual ~QuestEffectBeacon(); 86 86 87 87 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestEffectBeacon object through XML. 88 88 89 89 virtual void processEvent(Event& event); //!< Processes an event for this QuestEffectBeacon. 90 90 91 91 bool execute(bool b, PlayerTrigger* trigger); //!< Executes the QuestEffects of the QuestEffectBeacon. 92 92 93 93 /** 94 94 @brief Tests whether the QuestEffectBeacon is active. … … 97 97 inline bool isActive(void) 98 98 { return this->status_ == QuestEffectBeaconStatus::Active; } 99 99 100 100 bool setActive(bool activate); //!< Set the status of the QuestEffectBeacon. 101 101 102 102 protected: 103 103 bool decrementTimes(void); //!< Decrement the number of times the QuestEffectBeacon can still be executed. 104 104 105 105 /** 106 106 @brief Returns the number of times the QUestEffectBeacon can still be executed. … … 109 109 inline const int & getTimes(void) const 110 110 { return this->times_; } 111 111 112 112 private: 113 113 static const int INFINITE_TIME = -1; //!< Constant to avoid using magic numbers. 114 114 115 115 std::list<QuestEffect*> effects_; //!< The list of QuestEffects to be invoked on the executing player. 116 116 int times_; //!< Number of times the beacon can be exectued. 117 117 QuestEffectBeaconStatus::Value status_; //!< The status of the QUestEffectBeacon, Can be eighter active or inactive. 118 118 119 119 bool setTimes(const int & n); //!< Set the number of times the QuestEffectBeacon can be executed. 120 120 bool addEffect(QuestEffect* effect); //!< Add a QuestEffect to the QuestEffectBeacon. 121 121 122 122 const QuestEffect* getEffect(unsigned int index) const; //!< Get the QuestEffect at a given index. 123 123 124 124 }; 125 125
Note: See TracChangeset
for help on using the changeset viewer.