Changeset 2261 for code/trunk/src/orxonox/objects/quest/FailQuest.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/FailQuest.cc
- Property svn:mergeinfo changed
/code/branches/questsystem2/src/orxonox/objects/quest/FailQuest.cc (added) merged: 2146,2159,2191,2205,2226,2251 /code/trunk/src/orxonox/objects/quest/FailQuest.cc merged: 1925-2089
r2105 r2261 26 26 * 27 27 */ 28 29 /** 30 @file FailQuest.cc 31 @brief 32 Implementation of the FailQuest class. 33 */ 28 34 29 35 #include "OrxonoxStableHeaders.h" … … 33 39 #include "util/Exception.h" 34 40 41 #include "orxonox/objects/infos/PlayerInfo.h" 35 42 #include "QuestManager.h" 36 43 #include "Quest.h" … … 40 47 CreateFactory(FailQuest); 41 48 49 /** 50 @brief 51 Constructor. Registers the object. 52 */ 42 53 FailQuest::FailQuest(BaseObject* creator) : ChangeQuestStatus(creator) 43 54 { … … 53 64 } 54 65 66 /** 67 @brief 68 Method for creating a FailQuest object through XML. 69 */ 55 70 void FailQuest::XMLPort(Element& xmlelement, XMLPort::Mode mode) 56 71 { 57 72 SUPER(FailQuest, XMLPort, xmlelement, mode); 73 74 COUT(3) << "New FailQUest, with target Quest {" << this->getQuestId() << "}, created." << std::endl; 58 75 } 59 76 60 77 /** 61 78 @brief 62 Invokes the effect.79 Invokes the QuestEffect. 63 80 @param player 64 The player the effect is invoked on.81 The player the QuestEffect is invoked on. 65 82 @return 66 Returns true if the effect was invoked successfully.83 Returns true if the QuestEffect was invoked successfully. 67 84 */ 68 bool FailQuest::invoke(Player * player)85 bool FailQuest::invoke(PlayerInfo* player) 69 86 { 70 if(player == NULL) 87 if(player == NULL) //!< We don't know what to do with no player. 71 88 { 72 89 COUT(2) << "Input player is NULL." << std::endl; … … 74 91 } 75 92 93 COUT(3) << "FailQuest on player: " << player << " ." << std::endl; 94 95 Quest* quest; 76 96 try 77 97 { 78 Quest*quest = QuestManager::findQuest(this->getQuestId());79 if( !quest->fail(player))98 quest = QuestManager::findQuest(this->getQuestId()); 99 if(quest == NULL || !quest->fail(player)) 80 100 { 81 101 return false; … … 87 107 return false; 88 108 } 89 109 110 COUT(3) << "Quest {" << quest->getId() << "} failed by player: " << player << " ." << std::endl; 90 111 return true; 91 112 } - Property svn:mergeinfo changed
Note: See TracChangeset
for help on using the changeset viewer.