Changeset 7456 for code/trunk/src/modules/questsystem/effects
- Timestamp:
- Sep 15, 2010, 7:29:16 PM (14 years ago)
- Location:
- code/trunk/src/modules/questsystem/effects
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/questsystem/effects/AddQuest.cc
r7401 r7456 28 28 29 29 /** 30 @file 30 @file AddQuest.cc 31 31 @brief Implementation of the AddQuest class. 32 32 */ … … 34 34 #include "AddQuest.h" 35 35 36 #include "core/CoreIncludes.h" 37 #include "core/XMLPort.h" 36 38 #include "util/Exception.h" 37 #include "core/CoreIncludes.h" 39 40 #include "questsystem/Quest.h" 38 41 #include "questsystem/QuestManager.h" 39 #include "questsystem/Quest.h"40 42 41 43 namespace orxonox … … 81 83 bool AddQuest::invoke(PlayerInfo* player) 82 84 { 83 if(player == NULL) //!< Null-pointers are badass. 85 //TODO: Replace with assert? 86 if(player == NULL) // Null-pointers are badass. 84 87 { 85 88 COUT(2) << "Input player is NULL." << std::endl; … … 93 96 Quest* quest = QuestManager::getInstance().findQuest(this->getQuestId()); 94 97 if(quest == NULL || !quest->start(player)) 95 {96 98 return false; 97 }98 99 } 99 100 catch(const orxonox::Exception& ex) -
code/trunk/src/modules/questsystem/effects/AddQuest.h
r7401 r7456 28 28 29 29 /** 30 @file 30 @file AddQuest.h 31 31 @brief Definition of the AddQuest class. 32 @ingroup QuestEffects 32 33 */ 33 34 … … 42 43 /** 43 44 @brief 44 Adds a Quest, resp. changes the quests status to active for the player invoking the Quest.45 Adds a @ref orxonox::Quest "Quest", resp. changes the @ref orxonox::Quest "Quests" status to active for the player invoking the @ref orxonox::Quest "Quest". 45 46 46 Creating a AddQuest through XML goes as follows: 47 47 Creating an AddQuest through XML goes as follows: 48 48 @code 49 49 <AddQuest questId="id" /> //Where id identifies the Quest that should be added. -
code/trunk/src/modules/questsystem/effects/AddQuestHint.cc
r7401 r7456 28 28 29 29 /** 30 @file 30 @file AddQuestHint.cc 31 31 @brief Implementation of the AddQuestHint class. 32 32 */ … … 34 34 #include "AddQuestHint.h" 35 35 36 #include "util/Exception.h"37 36 #include "core/CoreIncludes.h" 38 37 #include "core/XMLPort.h" 38 #include "util/Exception.h" 39 40 #include "questsystem/QuestHint.h" 39 41 #include "questsystem/QuestManager.h" 40 42 #include "questsystem/QuestItem.h" 41 #include "questsystem/QuestHint.h"42 43 43 44 namespace orxonox … … 105 106 bool AddQuestHint::invoke(PlayerInfo* player) 106 107 { 107 if(player == NULL) //!< NULL-pointers are evil! 108 //TODO: Replace with assert? 109 if(player == NULL) // NULL-pointers are evil! 108 110 { 109 111 COUT(2) << "The input player is NULL." << std::endl; … … 117 119 QuestHint* hint = QuestManager::getInstance().findHint(this->hintId_); 118 120 if(hint == NULL || !hint->setActive(player)) 119 {120 121 return false; 121 }122 122 } 123 123 catch(const Exception& e) -
code/trunk/src/modules/questsystem/effects/AddQuestHint.h
r7401 r7456 28 28 29 29 /** 30 @file 30 @file AddQuestHint.h 31 31 @brief Definition of the AddQuestHint class. 32 @ingroup QuestEffects 32 33 */ 33 34 … … 44 45 /** 45 46 @brief 46 Adds a QuestHint, resp. activates the QuestHintof the given id for the player the QuestEffect is invoked on.47 Adds a @ref orxonox::QuestHint "QuestHint", resp. activates the @ref orxonox::QuestHint "QuestHint" of the given id for the player the QuestEffect is invoked on. 47 48 48 49 Creating a AddQuestHint through XML goes as follows: 49 50 50 @code 51 51 <AddQuestHint hintId="id" /> //Where id identifies the QuestHint that should be added. -
code/trunk/src/modules/questsystem/effects/AddReward.cc
r7401 r7456 28 28 29 29 /** 30 @file 30 @file AddReward.cc 31 31 @brief Implementation of the AddReward class. 32 32 */ … … 36 36 #include "core/CoreIncludes.h" 37 37 #include "core/XMLPort.h" 38 38 39 #include "interfaces/Rewardable.h" 39 40 … … 57 58 AddReward::~AddReward() 58 59 { 60 59 61 } 60 62 … … 85 87 { 86 88 if(i == 0) 87 {88 89 return *reward; 89 }90 90 i--; 91 91 } … … 107 107 bool check = true; 108 108 for ( std::list<Rewardable*>::iterator reward = this->rewards_.begin(); reward != this->rewards_.end(); ++reward ) 109 {110 109 check = check && (*reward)->reward(player); 111 }112 110 113 111 COUT(4) << "Rewardable successfully added to player." << player << " ." << std::endl; -
code/trunk/src/modules/questsystem/effects/AddReward.h
r7401 r7456 28 28 29 29 /** 30 @file 30 @file AddReward.h 31 31 @brief Definition of the AddReward class. 32 @ingroup QuestEffects 32 33 */ 33 34 … … 44 45 /** 45 46 @brief 46 Adds a list of Rewardablesto a player.47 Adds a list of @ref orxonox::Rewardable "Rewardables" to a player. 47 48 48 49 Creating a AddReward through XML goes as follows: 49 50 50 @code 51 51 <AddReward> -
code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.cc
r7401 r7456 28 28 29 29 /** 30 @file 30 @file ChangeQuestStatus.cc 31 31 @brief Implementation of the ChangeQuestStatus class. 32 @ingroup QuestEffects 32 33 */ 33 34 … … 36 37 #include "core/CoreIncludes.h" 37 38 #include "core/XMLPort.h" 39 38 40 #include "questsystem/QuestItem.h" 39 41 … … 55 57 ChangeQuestStatus::~ChangeQuestStatus() 56 58 { 59 57 60 } 58 61 -
code/trunk/src/modules/questsystem/effects/ChangeQuestStatus.h
r7401 r7456 28 28 29 29 /** 30 @file 30 @file ChangeQuestStatus.h 31 31 @brief Definition of the ChangeQuestStatus class. 32 @ingroup QuestEffects 32 33 */ 33 34 … … 44 45 /** 45 46 @brief 46 A QuestEffect which changes the status of a specified Questfor the player invoking the QuestEffect.47 A QuestEffect which changes the status of a specified @ref orxonox::Quest "Quest" for the player invoking the QuestEffect. 47 48 @author 48 49 Damian 'Mozork' Frick -
code/trunk/src/modules/questsystem/effects/CompleteQuest.cc
r7401 r7456 28 28 29 29 /** 30 @file 30 @file CompleteQuest.cc 31 31 @brief Implementation of the CompleteQuest class. 32 32 */ … … 36 36 #include "core/CoreIncludes.h" 37 37 #include "core/XMLPort.h" 38 39 #include "questsystem/Quest.h" 38 40 #include "questsystem/QuestManager.h" 39 #include "questsystem/Quest.h"40 41 41 42 namespace orxonox … … 58 59 CompleteQuest::~CompleteQuest() 59 60 { 61 60 62 } 61 63 … … 81 83 bool CompleteQuest::invoke(PlayerInfo* player) 82 84 { 83 if(player == NULL) //!< You know, what we think of NULL-pointers... 85 //TODO: Replace with assert? 86 if(player == NULL) // You know, what we think of NULL-pointers... 84 87 { 85 88 COUT(2) << "Input player is NULL." << std::endl; … … 95 98 quest = QuestManager::getInstance().findQuest(this->getQuestId()); 96 99 if(quest == NULL || !quest->complete(player)) 97 {98 100 return false; 99 }100 101 } 101 102 catch(const Exception& e) -
code/trunk/src/modules/questsystem/effects/CompleteQuest.h
r7401 r7456 28 28 29 29 /** 30 @file 30 @file CompleteQuest.h 31 31 @brief Definition of the CompleteQuest class. 32 @ingroup QuestEffects 32 33 */ 33 34 … … 42 43 /** 43 44 @brief 44 Completes a Quest(with a specified id) for the player invoking the QuestEffect.45 Completes a @ref orxonox::Quest "Quest" (with a specified id) for the player invoking the QuestEffect. 45 46 46 47 Creating a CompleteQuest through XML goes as follows: 47 48 48 @code 49 49 <CompleteQuest questId="id" /> //Where id identifies the Quest that should be completed. -
code/trunk/src/modules/questsystem/effects/FailQuest.cc
r7401 r7456 28 28 29 29 /** 30 @file 30 @file FailQuest.cc 31 31 @brief Implementation of the FailQuest class. 32 32 */ … … 36 36 #include "core/CoreIncludes.h" 37 37 #include "core/XMLPort.h" 38 39 #include "questsystem/Quest.h" 38 40 #include "questsystem/QuestManager.h" 39 #include "questsystem/Quest.h"40 41 41 42 namespace orxonox … … 58 59 FailQuest::~FailQuest() 59 60 { 61 60 62 } 61 63 … … 68 70 SUPER(FailQuest, XMLPort, xmlelement, mode); 69 71 70 COUT(4) << "New FailQ Uest, with target Quest {" << this->getQuestId() << "}, created." << std::endl;72 COUT(4) << "New FailQuest, with target Quest {" << this->getQuestId() << "}, created." << std::endl; 71 73 } 72 74 … … 81 83 bool FailQuest::invoke(PlayerInfo* player) 82 84 { 83 if(player == NULL) //!< We don't know what to do with no player. 85 //TODO: Replace with assert? 86 if(player == NULL) // We don't know what to do with no player. 84 87 { 85 88 COUT(2) << "Input player is NULL." << std::endl; … … 94 97 quest = QuestManager::getInstance().findQuest(this->getQuestId()); 95 98 if(quest == NULL || !quest->fail(player)) 96 {97 99 return false; 98 }99 100 } 100 101 catch(const Exception& e) -
code/trunk/src/modules/questsystem/effects/FailQuest.h
r7401 r7456 28 28 29 29 /** 30 @file 30 @file FailQuest.h 31 31 @brief Definition of the FailQuest class. 32 @ingroup QuestEffects 32 33 */ 33 34 … … 42 43 /** 43 44 @brief 44 Fails a quest(with a specified id) for the player invoking the QuestEffect.45 Fails a @ref orxonox::Quest "Quest" (with a specified id) for the player invoking the QuestEffect. 45 46 46 47 Creating a FailQuest through XML goes as follows: 47 48 48 @code 49 49 <FailQuest questId="id" /> //Where id identifies the Quest that should be failed.
Note: See TracChangeset
for help on using the changeset viewer.