Changeset 2261 for code/trunk/src/orxonox/objects/quest/AddQuestHint.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/AddQuestHint.cc
- Property svn:mergeinfo changed
/code/branches/questsystem2/src/orxonox/objects/quest/AddQuestHint.cc (added) merged: 2146,2159,2191,2205,2226,2251 /code/trunk/src/orxonox/objects/quest/AddQuestHint.cc merged: 1925-2089
r2105 r2261 27 27 */ 28 28 29 /** 30 @file AddQuestHint.cc 31 @brief 32 Implementation of the AddQuestHint class. 33 */ 34 29 35 #include "OrxonoxStableHeaders.h" 30 36 #include "AddQuestHint.h" … … 33 39 #include "util/Exception.h" 34 40 41 #include "orxonox/objects/infos/PlayerInfo.h" 35 42 #include "QuestManager.h" 36 43 #include "QuestItem.h" … … 41 48 CreateFactory(AddQuestHint); 42 49 50 /** 51 @brief 52 Constructor. Registers the object. 53 */ 43 54 AddQuestHint::AddQuestHint(BaseObject* creator) : QuestEffect(creator) 44 55 { … … 54 65 } 55 66 67 /** 68 @brief 69 Method for creating a AddQuestHint object through XML. 70 */ 56 71 void AddQuestHint::XMLPort(Element& xmlelement, XMLPort::Mode mode) 57 72 { … … 59 74 60 75 XMLPortParam(AddQuestHint, "hintId", setHintId, getHintId, xmlelement, mode); 61 76 77 COUT(3) << "New AddQuestHint, with target QuestHint {" << this->getHintId() << "}, created." << std::endl; 62 78 } 63 79 64 inline void AddQuestHint::setHintId(const std::string & id) 80 /** 81 @brief 82 Sets the id of the QuestHint to be added to the player the QuestEffect is invoked on. 83 @param id 84 The QuestHint id. 85 @param 86 Returns true if successful. 87 */ 88 bool AddQuestHint::setHintId(const std::string & id) 65 89 { 66 90 if(!QuestItem::isId(id)) 67 91 { 68 92 COUT(2) << "Invalid id. QuestItem id {" << id << "} could not be set." << std::endl; 69 return ;93 return false; 70 94 } 95 71 96 this->hintId_ = id; 97 return true; 72 98 } 73 99 74 100 /** 75 101 @brief 76 Invokes the effect.102 Invokes the QuestEffect. 77 103 @param player 78 104 The player. 79 105 @return 80 Returns true if the effect was successfully invoked.106 Returns true if the QuestEffect was successfully invoked. 81 107 */ 82 bool AddQuestHint::invoke(Player * player)108 bool AddQuestHint::invoke(PlayerInfo* player) 83 109 { 84 if(player == NULL) 110 if(player == NULL) //!< NULL-pointers are evil! 85 111 { 86 112 COUT(2) << "The input player is NULL." << std::endl; … … 88 114 } 89 115 116 COUT(3) << "AddQuestHint on player: " << player << " ." << std::endl; 117 90 118 try 91 119 { 92 120 QuestHint* hint = QuestManager::findHint(this->hintId_); 93 if( !hint->activate(player))121 if(hint == NULL || !hint->setActive(player)) 94 122 { 95 123 return false; … … 102 130 } 103 131 132 COUT(3) << "QuestHint {" << this->getHintId() << "} successfully added to player." << std::endl; 104 133 return true; 105 134 - Property svn:mergeinfo changed
Note: See TracChangeset
for help on using the changeset viewer.