Changeset 2353 for code/branches
- Timestamp:
- Dec 7, 2008, 11:44:17 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem3/src/orxonox/objects/quest/QuestListener.cc
r2352 r2353 53 53 RegisterObject(QuestListener); 54 54 55 this-> status_ = questListenerMode::all;55 this->mode_ = questListenerMode::all; 56 56 this->quest_ = NULL; 57 57 } … … 78 78 this->quest_->addListener(this); //!< Adds the QuestListener to the Quests list of listeners. 79 79 80 COUT(3) << "QuestListener created for quest: {" << this->quest_->getId() << "} with mode '" << this->get QuestStatus() << "'." << std::endl;80 COUT(3) << "QuestListener created for quest: {" << this->quest_->getId() << "} with mode '" << this->getMode() << "'." << std::endl; 81 81 } 82 82 … … 94 94 { 95 95 QuestListener* listener = *it; 96 if(listener->getMode() == status || listener->getMode() == questListenerMode::all) //!< Check whether the status change affects the give QuestListener.96 if(listener->getMode() == status || listener->getMode() == "all") //!< Check whether the status change affects the give QuestListener. 97 97 { 98 98 listener->execute(); … … 132 132 bool QuestListener::setMode(const std::string & mode) 133 133 { 134 if( status== "all")135 { 136 this-> status_ = questListenerMode::all;137 } 138 else if( status== "start")139 { 140 this-> status_ = questListenerMode::start;141 } 142 else if( status== "fail")143 { 144 this-> status_ = questListenerMode::fail;145 } 146 else if( status== "complete")147 { 148 this-> status_ = questListenerMode::complete;134 if(mode == "all") 135 { 136 this->mode_ = questListenerMode::all; 137 } 138 else if(mode == "start") 139 { 140 this->mode_ = questListenerMode::start; 141 } 142 else if(mode == "fail") 143 { 144 this->mode_ = questListenerMode::fail; 145 } 146 else if(mode == "complete") 147 { 148 this->mode_ = questListenerMode::complete; 149 149 } 150 150 else 151 151 { 152 152 COUT(2) << "QuestListener with invalid mode '" << mode << "' created. Mode set to 'all'." << std::endl; 153 this-> status_ = questListenerMode::all;153 this->mode_ = questListenerMode::all; 154 154 return false; 155 155 } … … 166 166 const std::string QuestListener::getMode(void) 167 167 { 168 if(this-> status_ == questListenerMode::all)168 if(this->mode_ == questListenerMode::all) 169 169 { 170 170 return "all"; 171 171 } 172 else if(this-> status_ == questListenerMode::start)172 else if(this->mode_ == questListenerMode::start) 173 173 { 174 174 return "start"; 175 175 } 176 else if(this-> status_ == questListenerMode::fail)176 else if(this->mode_ == questListenerMode::fail) 177 177 { 178 178 return "fail"; 179 179 } 180 else if(this-> status_ == questListenerMode::complete)180 else if(this->mode_ == questListenerMode::complete) 181 181 { 182 182 return "complete";
Note: See TracChangeset
for help on using the changeset viewer.