Changeset 11054 for code/branches/cpp11_v3/src/modules/questsystem/Quest.cc
- Timestamp:
- Jan 10, 2016, 1:54:11 PM (8 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/modules/questsystem/Quest.cc
r10624 r11054 55 55 RegisterObject(Quest); 56 56 57 this->parentQuest_ = NULL;57 this->parentQuest_ = nullptr; 58 58 } 59 59 … … 183 183 The index. 184 184 @return 185 Returns a pointer to the sub-quest at the given index. NULLif there is no element at the given index.185 Returns a pointer to the sub-quest at the given index. nullptr if there is no element at the given index. 186 186 */ 187 187 const Quest* Quest::getSubQuest(unsigned int index) const … … 190 190 191 191 // Iterate through all subquests. 192 for ( std::list<Quest*>::const_iterator subQuest = this->subQuests_.begin(); subQuest != this->subQuests_.end(); ++subQuest)192 for (Quest* quest : this->subQuests_) 193 193 { 194 194 if(i == 0) // We're counting down... 195 return *subQuest;195 return quest; 196 196 197 197 i--; 198 198 } 199 199 200 return NULL; // If the index is greater than the number of elements in the list.200 return nullptr; // If the index is greater than the number of elements in the list. 201 201 } 202 202 … … 207 207 The index. 208 208 @return 209 Returns a pointer to the QuestHint at the given index. NULLif there is no element at the given index.209 Returns a pointer to the QuestHint at the given index. nullptr if there is no element at the given index. 210 210 */ 211 211 const QuestHint* Quest::getHint(unsigned int index) const … … 214 214 215 215 // Iterate through all QuestHints. 216 for ( std::list<QuestHint*>::const_iterator hint = this->hints_.begin(); hint != this->hints_.end(); ++hint)216 for (QuestHint* hint : this->hints_) 217 217 { 218 218 if(i == 0) // We're counting down... 219 return *hint;219 return hint; 220 220 221 221 i--; 222 222 } 223 return NULL; // If the index is greater than the number of elements in the list.223 return nullptr; // If the index is greater than the number of elements in the list. 224 224 } 225 225 … … 230 230 The index. 231 231 @return 232 Returns a pointer to the fail QuestEffect at the given index. NULLif there is no element at the given index.232 Returns a pointer to the fail QuestEffect at the given index. nullptr if there is no element at the given index. 233 233 */ 234 234 const QuestEffect* Quest::getFailEffect(unsigned int index) const … … 237 237 238 238 // Iterate through all fail QuestEffects. 239 for ( std::list<QuestEffect*>::const_iterator effect = this->failEffects_.begin(); effect != this->failEffects_.end(); ++effect)239 for (QuestEffect* effect : this->failEffects_) 240 240 { 241 241 if(i == 0) // We're counting down... 242 return *effect;242 return effect; 243 243 244 244 i--; 245 245 } 246 return NULL; // If the index is greater than the number of elements in the list.246 return nullptr; // If the index is greater than the number of elements in the list. 247 247 } 248 248 … … 253 253 The index. 254 254 @return 255 Returns a pointer to the complete QuestEffect at the given index. NULLif there is no element at the given index.255 Returns a pointer to the complete QuestEffect at the given index. nullptr if there is no element at the given index. 256 256 */ 257 257 const QuestEffect* Quest::getCompleteEffect(unsigned int index) const … … 260 260 261 261 // Iterate through all complete QuestEffects. 262 for ( std::list<QuestEffect*>::const_iterator effect = this->completeEffects_.begin(); effect != this->completeEffects_.end(); ++effect)262 for (QuestEffect* effect : this->completeEffects_) 263 263 { 264 264 if(i == 0) // We're counting down... 265 return *effect;265 return effect; 266 266 267 267 i--; 268 268 } 269 return NULL; // If the index is greater than the number of elements in the list.269 return nullptr; // If the index is greater than the number of elements in the list. 270 270 } 271 271 … … 280 280 bool Quest::isInactive(const PlayerInfo* player) const 281 281 { 282 if(player == NULL)282 if(player == nullptr) 283 283 return true; 284 284 return this->getStatus(player) == QuestStatus::Inactive; … … 295 295 bool Quest::isActive(const PlayerInfo* player) const 296 296 { 297 if(player == NULL)297 if(player == nullptr) 298 298 return false; 299 299 return this->getStatus(player) == QuestStatus::Active; … … 310 310 bool Quest::isFailed(const PlayerInfo* player) const 311 311 { 312 if(player == NULL)312 if(player == nullptr) 313 313 return false; 314 314 return this->getStatus(player) == QuestStatus::Failed; … … 325 325 bool Quest::isCompleted(const PlayerInfo* player) const 326 326 { 327 if(player == NULL)327 if(player == nullptr) 328 328 return false; 329 329 return this->getStatus(player) == QuestStatus::Completed;
Note: See TracChangeset
for help on using the changeset viewer.