Changeset 5693 for code/trunk/src/orxonox/objects/quest/QuestManager.cc
- 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/QuestManager.cc
r3370 r5693 36 36 #include "util/Exception.h" 37 37 #include "core/CoreIncludes.h" 38 #include "core/GUIManager.h" 38 39 39 40 #include "objects/infos/PlayerInfo.h" 40 #include "objects/infos/PlayerInfo.h"41 #include "overlays/GUIOverlay.h"42 41 #include "Quest.h" 43 42 #include "QuestHint.h" … … 66 65 QuestManager::~QuestManager() 67 66 { 68 69 67 } 70 68 … … 203 201 /** 204 202 @brief 205 203 206 204 @param name 207 205 @return … … 209 207 QuestContainer* QuestManager::getQuestTree(std::string & name) 210 208 { 211 GUIOverlay* gui = NULL; 212 for (ObjectList<GUIOverlay>::iterator it = ObjectList<GUIOverlay>::begin(); it != ObjectList<GUIOverlay>::end(); ++it) 213 if (it->getGUIName() == name) 214 gui = *it; 215 216 PlayerInfo* player; 217 if(gui == NULL) 218 { 219 COUT(1) << "Error: No GUIOverlay with the given name '" << name << "' present." << std::endl; 209 PlayerInfo* player = GUIManager::getInstance().getPlayer(name); 210 if(player == NULL) 211 { 212 COUT(1) << "Error: GUIOverlay with name '" << name << "' has no player." << std::endl; 220 213 return NULL; 221 214 } 222 BaseObject* obj = gui->getOwner(); 223 if(obj == NULL) 224 { 225 COUT(1) << "Error: GUIOverlay has no owner. " << std::endl; 226 return NULL; 227 } 228 player = orxonox_cast<PlayerInfo*>(obj); 229 215 230 216 QuestContainer* root = NULL; 231 217 QuestContainer* current = NULL; 232 218 233 219 std::list<Quest*>* rootQuests = new std::list<Quest*>(); 234 220 getRootQuests(player, *rootQuests); 235 221 236 222 for(std::list<Quest*>::iterator it = rootQuests->begin(); it != rootQuests->end(); it++) 237 223 { … … 246 232 current->next = container; 247 233 } 248 234 249 235 current = container; 250 236 … … 260 246 /** 261 247 @brief 262 248 263 249 @param player 264 250 @param list … … 279 265 /** 280 266 @brief 281 267 282 268 @param quest 283 269 @param player … … 310 296 COUT(1) << "An error occurred. A Quest of un-specified status wanted to be displayed." << std::endl; 311 297 } 312 298 313 299 std::list<Quest*> quests = quest->getSubQuestList(); 314 300 QuestContainer* current = NULL; … … 329 315 current->next = subContainer; 330 316 } 331 317 332 318 current = subContainer; 333 319 } … … 336 322 current->next = NULL; 337 323 container->subQuests = first; 338 324 339 325 return container; 340 326 } … … 342 328 /** 343 329 @brief 344 330 345 331 @param quest 346 332 @param player … … 368 354 current->next = hint; 369 355 } 370 356 371 357 current = hint; 372 358 }
Note: See TracChangeset
for help on using the changeset viewer.