Changeset 2261 for code/trunk/src/orxonox/objects/quest/AddQuest.cc
- Timestamp:
- Nov 25, 2008, 11:56:40 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/questsystem2 (added) merged: 2109,2146,2159,2191,2193-2196,2205-2206,2208-2209,2221,2226,2228,2251,2258
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/quest/AddQuest.cc
- Property svn:mergeinfo changed
/code/branches/questsystem2/src/orxonox/objects/quest/AddQuest.cc (added) merged: 2146,2159,2191,2205,2209,2226,2251 /code/trunk/src/orxonox/objects/quest/AddQuest.cc merged: 1925-2089
r2105 r2261 27 27 */ 28 28 29 /** 30 @file AddQuest.cc 31 @brief 32 Implementation of the AddQuest class. 33 */ 34 29 35 #include "OrxonoxStableHeaders.h" 30 36 #include "AddQuest.h" 31 37 32 38 #include <string> 39 33 40 #include "core/CoreIncludes.h" 34 41 #include "util/Exception.h" 35 42 43 #include "orxonox/objects/infos/PlayerInfo.h" 36 44 #include "QuestManager.h" 37 45 #include "Quest.h" … … 41 49 CreateFactory(AddQuest); 42 50 43 51 /** 52 @brief 53 Constructor. Registers the object. 54 */ 44 55 AddQuest::AddQuest(BaseObject* creator) : ChangeQuestStatus(creator) 45 56 { … … 55 66 } 56 67 68 /** 69 @brief 70 Method for creating a AddQuest object through XML. 71 */ 57 72 void AddQuest::XMLPort(Element& xmlelement, XMLPort::Mode mode) 58 73 { 59 74 SUPER(AddQuest, XMLPort, xmlelement, mode); 60 75 76 COUT(3) << "New AddQuest, with target Quest {" << this->getQuestId() << "}, created." << std::endl; 61 77 } 62 78 63 79 /** 64 80 @brief 65 Invokes the effect.81 Invokes the QuestEffect. 66 82 @param player 67 The player the effect is invoked on.83 The player the QuestEffect is invoked on. 68 84 @return 69 Returns true if the effect was successfully invoked.85 Returns true if the QuestEffect was successfully invoked. 70 86 */ 71 bool AddQuest::invoke(Player * player)87 bool AddQuest::invoke(PlayerInfo* player) 72 88 { 73 if(player == NULL) 89 if(player == NULL) //!< Null-pointers are badass. 74 90 { 75 91 COUT(2) << "Input player is NULL." << std::endl; … … 77 93 } 78 94 95 COUT(3) << "AddQuest on player: " << player << " ." << std::endl; 96 79 97 try 80 98 { 81 99 Quest* quest = QuestManager::findQuest(this->getQuestId()); 82 if( !quest->start(player))100 if(quest == NULL || !quest->start(player)) 83 101 { 84 102 return false; … … 91 109 } 92 110 111 COUT(3) << "Quest {" << this->getQuestId() << "} successfully added to player." << std::endl; 93 112 return true; 94 113 } - Property svn:mergeinfo changed
Note: See TracChangeset
for help on using the changeset viewer.