Changeset 7456 for code/trunk/src/modules/questsystem/LocalQuest.cc
- Timestamp:
- Sep 15, 2010, 7:29:16 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/questsystem/LocalQuest.cc
r7163 r7456 28 28 29 29 /** 30 @file 30 @file LocalQuest.cc 31 31 @brief Implementation of the LocalQuest class. 32 32 */ … … 36 36 #include "core/CoreIncludes.h" 37 37 #include "core/XMLPort.h" 38 38 39 #include "QuestEffect.h" 39 40 … … 82 83 bool LocalQuest::fail(PlayerInfo* player) 83 84 { 84 if(!this->isFailable(player)) // !<Checks whether the quest can be failed.85 if(!this->isFailable(player)) // Checks whether the quest can be failed. 85 86 { 86 87 COUT(4) << "A non-failable quest was trying to be failed." << std::endl; … … 90 91 Quest::fail(player); 91 92 92 QuestEffect::invokeEffects(player, this->getFailEffectList()); // !<Invoke the failEffects.93 QuestEffect::invokeEffects(player, this->getFailEffectList()); // Invoke the failEffects. 93 94 return true; 94 95 } … … 105 106 bool LocalQuest::complete(PlayerInfo* player) 106 107 { 107 if(!this->isCompletable(player)) // !<Checks whether the Quest can be completed.108 if(!this->isCompletable(player)) // Checks whether the Quest can be completed. 108 109 { 109 110 COUT(4) << "A non-completable quest was trying to be completed." << std::endl; … … 113 114 Quest::complete(player); 114 115 115 QuestEffect::invokeEffects(player, this->getCompleteEffectList()); // !<Invoke the complete QuestEffects.116 QuestEffect::invokeEffects(player, this->getCompleteEffectList()); // Invoke the complete QuestEffects. 116 117 return true; 117 118 } … … 130 131 { 131 132 if(!(this->getParentQuest() == NULL || this->getParentQuest()->isActive(player))) 132 { 133 return false; 134 } 133 return false; 134 135 135 return this->isInactive(player); 136 136 } … … 178 178 QuestStatus::Value LocalQuest::getStatus(const PlayerInfo* player) const 179 179 { 180 if(player == NULL) //!< No player has no defined status.181 {180 //TODO: Replace with assert. 181 if(player == NULL) // No player has no defined status. 182 182 ThrowException(Argument, "The input PlayerInfo* is NULL."); 183 }184 183 185 184 std::map<const PlayerInfo*, QuestStatus::Value>::const_iterator it = this->playerStatus_.find(player); 186 if (it != this->playerStatus_.end()) //!< If there is a player in the map. 187 { 185 if (it != this->playerStatus_.end()) // If there is a player in the map. 188 186 return it->second; 189 } 190 191 return QuestStatus::Inactive; //!< If the player is not yet in the map, that means the status of the quest form him is 'inactive'. 187 188 return QuestStatus::Inactive; // If the player is not yet in the map, that means the status of the quest form him is 'inactive'. 192 189 } 193 190 … … 205 202 bool LocalQuest::setStatus(PlayerInfo* player, const QuestStatus::Value & status) 206 203 { 207 if(player == NULL) //!< We can't set a status for no player. 208 { 209 return false; 210 } 204 //TODO: Replace with assert. 205 if(player == NULL) // We can't set a status for no player. 206 return false; 211 207 212 208 this->playerStatus_[player] = status;
Note: See TracChangeset
for help on using the changeset viewer.