Changeset 2208 for code/branches/questsystem2/src/orxonox/objects
- Timestamp:
- Nov 14, 2008, 7:45:22 AM (16 years ago)
- Location:
- code/branches/questsystem2/src/orxonox/objects/quest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.cc
r2205 r2208 75 75 if(!b || !(this->isActive())) 76 76 { 77 COUT(3) << "The QuestEffectBeacon is inactive." << std::endl; 77 78 return false; 78 79 } 79 80 if(entity == NULL) 80 81 { 82 COUT(2) << "No one triggered the beacon? Curious!" << std::endl; 81 83 return false; 82 84 } 83 85 84 86 PlayerInfo* player = entity->getPlayer(); 87 88 if(player == NULL) 89 { 90 COUT(3) << "The PlayerInfo* is NULL." << std::endl; 91 return false; 92 } 85 93 86 94 bool check = QuestEffect::invokeEffects(player, this->effects_); -
code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.h
r2205 r2208 49 49 /** 50 50 @brief 51 51 A QuestEffectBeacon is an entity which can (under some condition(s)) invoke a number QuestEffects on players meeting the condition(s). 52 The conditions under which the QuestEffects are invoked on the player are defined by Triggers. 53 A QuestEffectBeacon can be executed a defined number of times. 52 54 @author 53 55 Damian 'Mozork' Frick … … 63 65 virtual void processEvent(Event& event); 64 66 65 bool execute(bool b, ControllableEntity* player); 67 bool execute(bool b, ControllableEntity* player); //!< Executes the QuestEffects of the QuestEffectBeacon. 66 68 67 bool isActive(void); 69 bool isActive(void); //!< Test whether the QuestEffectBeacon is active. 68 70 69 71 protected: 70 bool decrementTimes(void); 72 bool decrementTimes(void); //!< Decrement the number of times the QuestEffectBeacon can still be executed. 71 73 72 inline const int & getTimes(void) const 74 inline const int & getTimes(void) const //!< Return the number of times the QUestEffectBeacon can still be executed. 73 75 { return this->times_; } 74 76 75 77 private: 76 std::list<QuestEffect*> effects_; 78 std::list<QuestEffect*> effects_; //!< The list of QuestEffects to be invoked on the executing player. 77 79 int times_; //!< Number of times the beacon can be exectued. 78 QuestEffectBeaconStatus::Enum status_; 80 QuestEffectBeaconStatus::Enum status_; //!< The status of the QUestEffectBeacon, Can be eighter active or inactive. 79 81 PlayerTrigger* trigger_; 80 82 81 bool setTimes(const int & n); 83 bool setTimes(const int & n); //!< Set the number of times the QuestEffectBeacon can be executed. 82 84 bool addEffect(QuestEffect* effect); 83 85 bool addTrigger(PlayerTrigger* trigger);
Note: See TracChangeset
for help on using the changeset viewer.