- Timestamp:
- Dec 10, 2008, 4:19:44 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/orxonox/objects/quest/QuestEffectBeacon.h
r2262 r2385 29 29 /** 30 30 @file QuestEffectBeacon.h 31 @brief 32 Definition of the QuestEffectBeacon class. 31 @brief Definition of the QuestEffectBeacon class. 33 32 */ 34 33 … … 61 60 A QuestEffectBeacon can be inactive or active. 62 61 63 Creating a QuestEffectBeacon through XML goes as follows:64 65 <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.62 Creating a QuestEffectBeacon through XML goes as follows: 63 64 <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. 66 65 <effects> 67 66 <QuestEffect /> //A list of QuestEffects, invoked when the QuestEffectBeacon is executed, see QuestEffect for the full XML representation. … … 70 69 </effects> 71 70 <events> 72 <execute>73 <EventListener event=eventIdString />74 </execute>75 </events>76 <attached>77 <PlayerTrigger name=eventIdString /> //A PlayerTrigger triggering the execution of the QuestEffectBeacon.78 </attached>79 </QuestEffectBeacon>71 <execute> 72 <EventListener event=eventIdString /> 73 </execute> 74 </events> 75 <attached> 76 <PlayerTrigger name=eventIdString /> //A PlayerTrigger triggering the execution of the QuestEffectBeacon. 77 </attached> 78 </QuestEffectBeacon> 80 79 @author 81 80 Damian 'Mozork' Frick … … 83 82 class _OrxonoxExport QuestEffectBeacon : public PositionableEntity 84 83 { 85 public:86 QuestEffectBeacon(BaseObject* creator);87 virtual ~QuestEffectBeacon();88 89 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestEffectBeacon object through XML.90 91 virtual void processEvent(Event& event); //!< Processes an event for this QuestEffectBeacon.92 93 bool execute(bool b, PlayerTrigger* trigger); //!< Executes the QuestEffects of the QuestEffectBeacon.94 95 /**96 @brief Tests whether the QuestEffectBeacon is active.97 @return Returns true if the QuestEffectBeacon is active, fals if not.98 */99 inline bool isActive(void)100 { return this->status_ == QuestEffectBeaconStatus::active; }101 102 bool setActive(bool activate); //!< Set the status of the QuestEffectBeacon.103 104 protected:84 public: 85 QuestEffectBeacon(BaseObject* creator); 86 virtual ~QuestEffectBeacon(); 87 88 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestEffectBeacon object through XML. 89 90 virtual void processEvent(Event& event); //!< Processes an event for this QuestEffectBeacon. 91 92 bool execute(bool b, PlayerTrigger* trigger); //!< Executes the QuestEffects of the QuestEffectBeacon. 93 94 /** 95 @brief Tests whether the QuestEffectBeacon is active. 96 @return Returns true if the QuestEffectBeacon is active, fals if not. 97 */ 98 inline bool isActive(void) 99 { return this->status_ == QuestEffectBeaconStatus::active; } 100 101 bool setActive(bool activate); //!< Set the status of the QuestEffectBeacon. 102 103 protected: 105 104 bool decrementTimes(void); //!< Decrement the number of times the QuestEffectBeacon can still be executed. 106 105 … … 111 110 inline const int & getTimes(void) const 112 111 { return this->times_; } 113 112 114 113 private: 115 114 static const int INFINITE = -1; //!< Constant to avoid using magic numbers. 116 115 117 116 std::list<QuestEffect*> effects_; //!< The list of QuestEffects to be invoked on the executing player. 118 117 int times_; //!< Number of times the beacon can be exectued.
Note: See TracChangeset
for help on using the changeset viewer.