Changeset 2191 for code/branches/questsystem2/src/orxonox/objects/quest
- Timestamp:
- Nov 12, 2008, 1:29:33 PM (16 years ago)
- Location:
- code/branches/questsystem2/src/orxonox/objects/quest
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem2/src/orxonox/objects/quest/AddQuest.cc
r2159 r2191 51 51 /** 52 52 @brief 53 Constructor. Registers the quest.53 Constructor. Registers the object. 54 54 */ 55 55 AddQuest::AddQuest(BaseObject* creator) : ChangeQuestStatus(creator) … … 78 78 /** 79 79 @brief 80 Invokes the effect.80 Invokes the QuestEffect. 81 81 @param player 82 The player the effect is invoked on.82 The player the QuestEffect is invoked on. 83 83 @return 84 Returns true if the effect was successfully invoked.84 Returns true if the QuestEffect was successfully invoked. 85 85 */ 86 86 bool AddQuest::invoke(ControllableEntity* player) -
code/branches/questsystem2/src/orxonox/objects/quest/AddQuest.h
r2159 r2191 47 47 /** 48 48 @brief 49 Adds a quest, resp. changes the quests status to active for the player invoking the quest.49 Adds a Quest, resp. changes the quests status to active for the player invoking the Quest. 50 50 @author 51 51 Damian 'Mozork' Frick … … 59 59 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddQuest object through XML. 60 60 61 virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.61 virtual bool invoke(ControllableEntity* player); //!< Invokes the QuestEffect. 62 62 63 63 }; -
code/branches/questsystem2/src/orxonox/objects/quest/AddQuestHint.cc
r2159 r2191 79 79 /** 80 80 @brief 81 Sets the id of the quest hint to be added to the player the effect is invoked on.81 Sets the id of the QuestHint to be added to the player the QuestEffect is invoked on. 82 82 @param id 83 83 The QuestHint id. … … 85 85 Returns true if successful. 86 86 */ 87 inline voidAddQuestHint::setHintId(const std::string & id)87 bool AddQuestHint::setHintId(const std::string & id) 88 88 { 89 89 if(!QuestItem::isId(id)) … … 99 99 /** 100 100 @brief 101 Invokes the effect.101 Invokes the QuestEffect. 102 102 @param player 103 103 The player. 104 104 @return 105 Returns true if the effect was successfully invoked.105 Returns true if the QuestEffect was successfully invoked. 106 106 */ 107 107 bool AddQuestHint::invoke(ControllableEntity* player) -
code/branches/questsystem2/src/orxonox/objects/quest/AddQuestHint.h
r2159 r2191 46 46 /** 47 47 @brief 48 Adds a QuestHint, resp. activates the QuestHint of the given id for the player the effect is invoked on.48 Adds a QuestHint, resp. activates the QuestHint of the given id for the player the QuestEffect is invoked on. 49 49 @author 50 50 Damian 'Mozork' Frick … … 58 58 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddQuestHint object through XML. 59 59 60 virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.60 virtual bool invoke(ControllableEntity* player); //!< Invokes the QuestEffect. 61 61 62 62 private: 63 63 std::string hintId_; //!< The id of the QuestHint. 64 64 65 inline const std::string & getHintId(void) const //!< Returns the if of the hint. 65 /** 66 @brief Returns the id of the QuestHint. 67 @return Returns the id of the QuestHint. 68 */ 69 inline const std::string & getHintId(void) const 66 70 { return this->hintId_; } 67 void setHintId(const std::string & id); //!< Sets the id of the hint.71 bool setHintId(const std::string & id); //!< Sets the id of the QuestHint. 68 72 69 73 }; -
code/branches/questsystem2/src/orxonox/objects/quest/AddReward.cc
r2159 r2191 75 75 /** 76 76 @brief 77 Returns the rewardbale object at the given index.77 Returns the Rewardable object at the given index. 78 78 @param index 79 79 The index. 80 80 @return 81 Returns a pointer to the rewardable object at the given index.81 Returns a pointer to the Rewardable object at the given index. 82 82 */ 83 83 const Rewardable* AddReward::getRewardables(unsigned int index) const … … 97 97 /** 98 98 @brief 99 Invokes the effect.99 Invokes the QuestEffect. 100 100 @param player 101 101 The player. 102 102 @return 103 Returns true if the effect was invoked successfully.103 Returns true if the QuestEffect was invoked successfully. 104 104 */ 105 105 bool AddReward::invoke(ControllableEntity* player) -
code/branches/questsystem2/src/orxonox/objects/quest/AddReward.h
r2159 r2191 47 47 /** 48 48 @brief 49 Adds a list of rewards to a player.49 Adds a list of Rewardables to a player. 50 50 @author 51 51 Damian 'Mozork' Frick … … 59 59 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddReward object through XML. 60 60 61 virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.61 virtual bool invoke(ControllableEntity* player); //!< Invokes the QuestEffect. 62 62 63 63 private: 64 std::list<Rewardable*> rewards_; //!< A list of rewards to be added to the player invoking the effect.64 std::list<Rewardable*> rewards_; //!< A list of Rewardables to be added to the player invoking the QuestEffect. 65 65 66 inline void addRewardable(Rewardable* reward) //!< Add a rewardable object to the list of objects to be awarded to the player invoking the effect. 66 /** 67 @brief Add a Rewardable object to the list of objects to be awarded to the player invoking the QuestEffect. 68 @param reward Pointer to the Rewardable to be added. 69 */ 70 inline void addRewardable(Rewardable* reward) 67 71 { this->rewards_.push_back(reward); } 68 const Rewardable* getRewardables(unsigned int index) const; //!< Returns the rewardable object at the given index.72 const Rewardable* getRewardables(unsigned int index) const; //!< Returns the Rewardable object at the given index. 69 73 70 74 }; -
code/branches/questsystem2/src/orxonox/objects/quest/ChangeQuestStatus.cc
r2159 r2191 61 61 /** 62 62 @brief 63 Sets the id of the quest the effect chagnes the status of.63 Sets the id of the Quest the Questffect changes the status of. 64 64 @param id 65 The id of the quest.65 The id of the Quest. 66 66 @return 67 67 Returns true if successful. -
code/branches/questsystem2/src/orxonox/objects/quest/ChangeQuestStatus.h
r2159 r2191 47 47 /** 48 48 @brief 49 A n effect which changes a quests status of a specified quest for the player invoking the effect.49 A QuestEffect which changes the status of a specified Quest for the player invoking the QuestEffect. 50 50 @author 51 51 Damian 'Mozork' Frick … … 59 59 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a ChangeQuestStatus object through XML. 60 60 61 virtual bool invoke(ControllableEntity* player) = 0; //!< Invokes the effect.61 virtual bool invoke(ControllableEntity* player) = 0; //!< Invokes the QuestEffect. 62 62 63 63 protected: 64 inline const std::string & getQuestId(void) const //!< Returns the quest id. 64 /** 65 @brief Returns the id of the Quest. 66 @return Returns the id of the Quest. 67 */ 68 inline const std::string & getQuestId(void) const 65 69 { return this->questId_; } 66 70 67 71 private: 68 std::string questId_; //!< The id of the quest the status should be changed of.72 std::string questId_; //!< The id of the Quest the status should be changed of. 69 73 70 void setQuestId(const std::string & id); //!< Sets the quest id.74 bool setQuestId(const std::string & id); //!< Sets the id of the Quest. 71 75 72 76 }; -
code/branches/questsystem2/src/orxonox/objects/quest/CompleteQuest.cc
r2159 r2191 75 75 /** 76 76 @brief 77 Invokes the effect.77 Invokes the QuestEffect. 78 78 @param player 79 The player the effect is invoked on.79 The player the QuestEffect is invoked on. 80 80 @return 81 Returns true if the effect was invoked successfully.81 Returns true if the QuestEffect was invoked successfully. 82 82 */ 83 83 bool CompleteQuest::invoke(ControllableEntity* player) -
code/branches/questsystem2/src/orxonox/objects/quest/CompleteQuest.h
r2159 r2191 47 47 /** 48 48 @brief 49 Completes a quest (with a specified id) for the player invoking the effect.49 Completes a Quest (with a specified id) for the player invoking the QuestEffect. 50 50 @author 51 51 Damian 'Mozork' Frick … … 59 59 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a CompleteQuest object through XML. 60 60 61 virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.61 virtual bool invoke(ControllableEntity* player); //!< Invokes the QuestEffect. 62 62 63 63 }; -
code/branches/questsystem2/src/orxonox/objects/quest/FailQuest.cc
r2159 r2191 75 75 /** 76 76 @brief 77 Invokes the effect.77 Invokes the QuestEffect. 78 78 @param player 79 The player the effect is invoked on.79 The player the QuestEffect is invoked on. 80 80 @return 81 Returns true if the effect was invoked successfully.81 Returns true if the QuestEffect was invoked successfully. 82 82 */ 83 83 bool FailQuest::invoke(ControllableEntity* player) -
code/branches/questsystem2/src/orxonox/objects/quest/FailQuest.h
r2159 r2191 59 59 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a FailQuest object through XML. 60 60 61 virtual bool invoke(ControllableEntity* player); //!< Invokes the effect.61 virtual bool invoke(ControllableEntity* player); //!< Invokes the QuestEffect. 62 62 63 63 }; -
code/branches/questsystem2/src/orxonox/objects/quest/GlobalQuest.cc
r2159 r2191 79 79 /** 80 80 @brief 81 Fails the quest for all players.82 Invokes the fail Effects on all the players possessing this quest.81 Fails the Quest for all players. 82 Invokes the fail QuestEffects on all the players possessing this Quest. 83 83 @param player 84 84 The player failing it. 85 85 @return 86 Returns true if the quest could be failed, false if not.86 Returns true if the Quest could be failed, false if not. 87 87 */ 88 88 bool GlobalQuest::fail(ControllableEntity* player) 89 89 { 90 if(this->isFailable(player)) //!< Check whether the quest can be failed.90 if(this->isFailable(player)) //!< Check whether the Quest can be failed. 91 91 { 92 92 this->setStatus(player, questStatus::failed); 93 93 94 //! Iterate through all players possessing this quest.94 //! Iterate through all players possessing this Quest. 95 95 for(std::set<ControllableEntity*>::const_iterator it = players_.begin(); it != players_.end(); it++) 96 96 { … … 107 107 /** 108 108 @brief 109 Completes the quest for all players.110 Invokes the complete Effects on all the players possessing this quest.111 Invokes the reward effects on the player completing the quest.109 Completes the Quest for all players. 110 Invokes the complete QuestEffects on all the players possessing this Quest. 111 Invokes the reward QuestEffects on the player completing the Quest. 112 112 @param player 113 113 The player completing it. 114 114 @return 115 Returns true if the quest could be completed, false if not.115 Returns true if the Quest could be completed, false if not. 116 116 */ 117 117 bool GlobalQuest::complete(ControllableEntity* player) 118 118 { 119 if(this->isCompletable(player)) //!< Check whether the quest can be completed.119 if(this->isCompletable(player)) //!< Check whether the Quest can be completed. 120 120 { 121 121 this->setStatus(player, questStatus::completed); 122 122 123 //! Iterate through all players possessing the quest.123 //! Iterate through all players possessing the Quest. 124 124 for(std::set<ControllableEntity*>::const_iterator it = players_.begin(); it != players_.end(); it++) 125 125 { … … 127 127 } 128 128 129 QuestEffect::invokeEffects(player, this->rewards_); //!< Invoke reward effects on the player completing the quest.129 QuestEffect::invokeEffects(player, this->rewards_); //!< Invoke reward QuestEffects on the player completing the Quest. 130 130 return true; 131 131 } … … 137 137 /** 138 138 @brief 139 Checks whether the quest can be started.139 Checks whether the Quest can be started. 140 140 @param player 141 141 The player for whom is to be checked. … … 152 152 /** 153 153 @brief 154 Checks whether the quest can be failed.154 Checks whether the Quest can be failed. 155 155 @param player 156 156 The player for whom is to be checked. 157 157 @return 158 Returns true if the quest can be failed, false if not.158 Returns true if the Quest can be failed, false if not. 159 159 @throws 160 160 Throws an Exception if isActive() throws one. … … 168 168 /** 169 169 @brief 170 Checks whether the quest can be completed.170 Checks whether the Quest can be completed. 171 171 @param player 172 172 The player for whom is to be checked. 173 173 @return 174 Returns true if the quest can be completed, false if not.174 Returns true if the Quest can be completed, false if not. 175 175 @throws 176 176 Throws an Exception if isActive() throws one. … … 183 183 /** 184 184 @brief 185 Returns the status of the quest for a specific player.185 Returns the status of the Quest for a specific player. 186 186 @param player 187 187 The player. … … 237 237 /** 238 238 @brief 239 Adds a reward effect to the list of reward effects.239 Adds a reward QuestEffect to the list of reward QuestEffects. 240 240 @param effect 241 The effect to be added.241 The QuestEffect to be added. 242 242 @return 243 243 Returns true if successful. … … 251 251 } 252 252 253 this->rewards_.push_back(effect); //!< Add the effect to the list.253 this->rewards_.push_back(effect); //!< Add the QuestEffect to the list. 254 254 255 255 COUT(3) << "Reward effect was added to Quest {" << this->getId() << "}." << std::endl; … … 259 259 /** 260 260 @brief 261 Returns the reward effect at the given index.261 Returns the reward QuestEffect at the given index. 262 262 @param index 263 263 The index. -
code/branches/questsystem2/src/orxonox/objects/quest/GlobalQuest.h
r2159 r2191 48 48 /** 49 49 @brief 50 Global quests are quests, that have the same status for all players.50 GlobalQuests are Quests, that have the same status for all players. 51 51 This means, that when a player successfully completes a GlobalQuest, it is completed for all players that have it. 52 52 … … 92 92 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a GlobalQuest object through XML. 93 93 94 virtual bool fail(ControllableEntity* player); //!< Fails the quest.95 virtual bool complete(ControllableEntity* player); //!< Completes the quest.94 virtual bool fail(ControllableEntity* player); //!< Fails the Quest. 95 virtual bool complete(ControllableEntity* player); //!< Completes the Quest. 96 96 97 97 protected: 98 virtual bool isStartable(const ControllableEntity* player) const; //!< Checks whether the quest can be started.99 virtual bool isFailable(const ControllableEntity* player) const; //!< Checks whether the quest can be failed.100 virtual bool isCompletable(const ControllableEntity* player) const; //!< Checks whether the quest can be completed.98 virtual bool isStartable(const ControllableEntity* player) const; //!< Checks whether the Quest can be started. 99 virtual bool isFailable(const ControllableEntity* player) const; //!< Checks whether the Quest can be failed. 100 virtual bool isCompletable(const ControllableEntity* player) const; //!< Checks whether the Quest can be completed. 101 101 102 virtual questStatus::Enum getStatus(const ControllableEntity* player) const; //!< Returns the status of the quest for a specific player.102 virtual questStatus::Enum getStatus(const ControllableEntity* player) const; //!< Returns the status of the Quest for a specific player. 103 103 virtual bool setStatus(ControllableEntity* player, const questStatus::Enum & status); //!< Sets the status for a specific player. 104 104 105 105 private: 106 std::set<ControllableEntity*> players_; //!< The set of players which possess this quest.107 questStatus::Enum status_; //!< The status of this quest.108 std::list<QuestEffect*> rewards_; //!< Reward effects only invoked on the player completing the quest.106 std::set<ControllableEntity*> players_; //!< The set of players which possess this Quest. 107 questStatus::Enum status_; //!< The status of this Quest. 108 std::list<QuestEffect*> rewards_; //!< Reward QuestEffects only invoked on the player completing the Quest. 109 109 110 bool addRewardEffect(QuestEffect* effect); //!< Adds a reward effect to the list of reward effects.111 const QuestEffect* getRewardEffects(unsigned int index) const; //!< Returns the reward effect at the given index.110 bool addRewardEffect(QuestEffect* effect); //!< Adds a reward QuestEffect to the list of reward QuestEffects. 111 const QuestEffect* getRewardEffects(unsigned int index) const; //!< Returns the reward QuestEffect at the given index. 112 112 113 113 }; -
code/branches/questsystem2/src/orxonox/objects/quest/LocalQuest.cc
r2159 r2191 77 77 /** 78 78 @brief 79 Fails the quest for a given player.79 Fails the Quest for a given player. 80 80 Invokes all the failEffects on the player. 81 81 @param player 82 82 The player. 83 83 @return 84 Returns true if the quest could be failed, false if not.84 Returns true if the Quest could be failed, false if not. 85 85 */ 86 86 bool LocalQuest::fail(ControllableEntity* player) … … 99 99 /** 100 100 @brief 101 Completes the quest for a given player.102 Invokes all the complete Effects on the player.101 Completes the Quest for a given player. 102 Invokes all the complete QuestEffects on the player. 103 103 @param player 104 104 The player. 105 105 @return 106 Returns true if the quest could be completed, false if not.106 Returns true if the Quest could be completed, false if not. 107 107 */ 108 108 bool LocalQuest::complete(ControllableEntity* player) 109 109 { 110 if(this->isCompletable(player)) //!< Checks whether the quest can be completed.110 if(this->isCompletable(player)) //!< Checks whether the Quest can be completed. 111 111 { 112 112 this->setStatus(player, questStatus::completed); 113 QuestEffect::invokeEffects(player, this->getCompleteEffectList()); //!< Invoke the complete Effects.113 QuestEffect::invokeEffects(player, this->getCompleteEffectList()); //!< Invoke the complete QuestEffects. 114 114 return true; 115 115 } … … 121 121 /** 122 122 @brief 123 Checks whether the quest can be started.123 Checks whether the Quest can be started. 124 124 @param player 125 125 The player for whom is to be checked. 126 126 @return 127 Returns true if the quest can be started, false if not.127 Returns true if the Quest can be started, false if not. 128 128 @throws 129 129 Throws an exception if isInactive(ControllableEntity*) throws one. … … 136 136 /** 137 137 @brief 138 Checks whether the quest can be failed.138 Checks whether the Quest can be failed. 139 139 @param player 140 140 The player for whom is to be checked. 141 141 @return 142 Returns true if the quest can be failed, false if not.142 Returns true if the Quest can be failed, false if not. 143 143 @throws 144 144 Throws an exception if isActive(ControllableEntity*) throws one. … … 151 151 /** 152 152 @brief 153 Checks whether the quest can be completed.153 Checks whether the Quest can be completed. 154 154 @param player 155 155 The player for whom is to be checked. 156 156 @return 157 Returns true if the quest can be completed, false if not.157 Returns true if the Quest can be completed, false if not. 158 158 @throws 159 159 Throws an exception if isInactive(ControllableEntity*) throws one. … … 166 166 /** 167 167 @brief 168 Returns the status of the quest for a specific player.168 Returns the status of the Quest for a specific player. 169 169 @param player 170 170 The player. 171 171 @return 172 Returns the status of the quest for the input player.172 Returns the status of the Quest for the input player. 173 173 @throws 174 174 Throws an Exception if player is NULL. -
code/branches/questsystem2/src/orxonox/objects/quest/LocalQuest.h
r2159 r2191 48 48 /** 49 49 @brief 50 Handles quests which have different states for different players.50 Handles Quests which have different states for different players. 51 51 LocalQuests have (as opposed to GlobalQuests) a different state for each player, that means if for one player the status of the Quest changes it does not for all the other players which also possess this quest. 52 52 … … 87 87 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a LocalQuest object through XML. 88 88 89 virtual bool fail(ControllableEntity* player); //!< Fails the quest.90 virtual bool complete(ControllableEntity* player); //!< Completes the quest.89 virtual bool fail(ControllableEntity* player); //!< Fails the Quest. 90 virtual bool complete(ControllableEntity* player); //!< Completes the Quest. 91 91 92 92 protected: 93 virtual bool isStartable(const ControllableEntity* player) const; //!< Checks whether the quest can be started.94 virtual bool isFailable(const ControllableEntity* player) const; //!< Checks whether the quest can be failed.95 virtual bool isCompletable(const ControllableEntity* player) const; //!< Checks whether the quest can be completed.93 virtual bool isStartable(const ControllableEntity* player) const; //!< Checks whether the Quest can be started. 94 virtual bool isFailable(const ControllableEntity* player) const; //!< Checks whether the Quest can be failed. 95 virtual bool isCompletable(const ControllableEntity* player) const; //!< Checks whether the Quest can be completed. 96 96 97 virtual questStatus::Enum getStatus(const ControllableEntity* player) const; //!< Returns the status of the quest for a specific player.97 virtual questStatus::Enum getStatus(const ControllableEntity* player) const; //!< Returns the status of the Quest for a specific player. 98 98 virtual bool setStatus(ControllableEntity* player, const questStatus::Enum & status); //!< Sets the status for a specific player. 99 99 -
code/branches/questsystem2/src/orxonox/objects/quest/Quest.cc
r2159 r2191 84 84 /** 85 85 @brief 86 Sets the parent quest of the quest.86 Sets the parentquest of the Quest. 87 87 @param quest 88 A pointer to the quest to be set as parentquest.89 @return 90 Returns true if the parent Quest could be set.88 A pointer to the Quest to be set as parentquest. 89 @return 90 Returns true if the parentquest could be set. 91 91 */ 92 92 bool Quest::setParentQuest(Quest* quest) … … 106 106 /** 107 107 @brief 108 Adds a sub quest to the quest.108 Adds a subquest to the Quest. 109 109 @param quest 110 A pointer to the quest to be set as subquest.111 @return 112 Returns true if the sub Quest vould be set.110 A pointer to the Quest to be set as subquest. 111 @return 112 Returns true if the subquest could be set. 113 113 */ 114 114 bool Quest::addSubQuest(Quest* quest) … … 120 120 } 121 121 122 quest->setParentQuest(this); //!< Sets the current quest (this) as parentquest for the added subquest.123 this->subQuests_.push_back(quest); //!< Adds the quest to the end of the list of subquests.122 quest->setParentQuest(this); //!< Sets the currentQuest (this) as parentquest for the added subquest. 123 this->subQuests_.push_back(quest); //!< Adds the Quest to the end of the list of subquests. 124 124 125 125 COUT(3) << "Sub Quest {" << quest->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl; … … 130 130 /** 131 131 @brief 132 Adds a Hint to the list of hints132 Adds a QuestHint to the list of QuestHints 133 133 @param hint 134 The hint that should be added to the list of hints.134 The QuestHint that should be added to the list of QuestHints. 135 135 @return 136 136 Returns true if the hint was successfully added. … … 144 144 } 145 145 146 hint->setQuest(this); //!< Sets the current quest (this) as quest for the added hint.147 this->hints_.push_back(hint); //!< Adds the hint to the end of the list of hints.146 hint->setQuest(this); //!< Sets the current Quest (this) as Quest for the added QuestHint. 147 this->hints_.push_back(hint); //!< Adds the QuestHint to the end of the list of QuestHints. 148 148 149 149 COUT(3) << "QuestHint {" << hint->getId() << "} was added to Quest {" << this->getId() << "}." << std::endl; … … 153 153 /** 154 154 @brief 155 Adds an effect to the list of failEffects.155 Adds an QuestEffect to the list of fail QuestEffects. 156 156 @param effect 157 157 The QuestEffect to be added. … … 167 167 } 168 168 169 this->failEffects_.push_back(effect); //!< Adds the effect to the end of the list of failEffects.169 this->failEffects_.push_back(effect); //!< Adds the QuestEffect to the end of the list of fail QuestEffects. 170 170 171 171 COUT(3) << "A FailEffect was added to Quest {" << this->getId() << "}." << std::endl; … … 175 175 /** 176 176 @brief 177 Adds an effect to the list of completeEffects.177 Adds an QuestEffect to the list of complete QuestEffects. 178 178 @param effect 179 179 The QuestEffect to be added. … … 189 189 } 190 190 191 this->completeEffects_.push_back(effect); //!< Adds the effect to the end of the list of completeEffects.191 this->completeEffects_.push_back(effect); //!< Adds the QuestEffect to the end of the list of complete QuestEffects. 192 192 193 193 COUT(3) << "A CompleteEffect was added to Quest {" << this->getId() << "}." << std::endl; … … 197 197 /** 198 198 @brief 199 Returns the parent quest of the quest.200 @return 201 Returns the parent quest of the quest.199 Returns the parentquest of the Quest. 200 @return 201 Returns a pointer to the parentquest of the Quest. 202 202 */ 203 203 const Quest* Quest::getParentQuest(void) … … 208 208 /** 209 209 @brief 210 Returns the sub quest ofthe given index.210 Returns the subquest at the given index. 211 211 @param 212 212 The index. 213 213 @return 214 Returns the subquest of the given index. NULL if there is no element onthe given index.214 Returns a pointer to the subquest at the given index. NULL if there is no element at the given index. 215 215 */ 216 216 const Quest* Quest::getSubQuest(unsigned int index) const … … 233 233 /** 234 234 @brief 235 Returns the hint ofthe given index.235 Returns the QuestHint at the given index. 236 236 @param 237 237 The index. 238 238 @return 239 Returns the hint of the given index. NULL if there is no element onthe given index.239 Returns a pointer to the QuestHint at the given index. NULL if there is no element at the given index. 240 240 */ 241 241 const QuestHint* Quest::getHint(unsigned int index) const … … 243 243 int i = index; 244 244 245 //! Iterate through all hints.245 //! Iterate through all QuestHints. 246 246 for (std::list<QuestHint*>::const_iterator hint = this->hints_.begin(); hint != this->hints_.end(); ++hint) 247 247 { … … 257 257 /** 258 258 @brief 259 Returns the fail Effect ofthe given index.259 Returns the fail QuestEffect at the given index. 260 260 @param 261 261 The index. 262 262 @return 263 Returns the failEffect of the given index. NULL if there is no element onthe given index.263 Returns a pointer to the fail QuestEffect at the given index. NULL if there is no element at the given index. 264 264 */ 265 265 const QuestEffect* Quest::getFailEffect(unsigned int index) const … … 267 267 int i = index; 268 268 269 //! Iterate through all fail Effects.269 //! Iterate through all fail QuestEffects. 270 270 for (std::list<QuestEffect*>::const_iterator effect = this->failEffects_.begin(); effect != this->failEffects_.end(); ++effect) 271 271 { … … 281 281 /** 282 282 @brief 283 Returns the complete Effect ofthe given index.283 Returns the complete QuestEffect at the given index. 284 284 @param 285 285 The index. 286 286 @return 287 Returns the completeEffect of the given index. NULL if there is no element onthe given index.287 Returns a pointer to the complete QuestEffect at the given index. NULL if there is no element at the given index. 288 288 */ 289 289 const QuestEffect* Quest::getCompleteEffect(unsigned int index) const … … 291 291 int i = index; 292 292 293 //! Iterate through all complete Effects.293 //! Iterate through all complete QuestEffects. 294 294 for (std::list<QuestEffect*>::const_iterator effect = this->completeEffects_.begin(); effect != this->completeEffects_.end(); ++effect) 295 295 { … … 366 366 /** 367 367 @brief 368 Starts the quest for an input player.369 @param player 370 The player. 371 @return 372 Returns true if the quest could be started, false if not.368 Starts the Quest for an input player. 369 @param player 370 The player. 371 @return 372 Returns true if the Quest could be started, false if not. 373 373 */ 374 374 bool Quest::start(ControllableEntity* player) -
code/branches/questsystem2/src/orxonox/objects/quest/Quest.h
r2159 r2191 50 50 { 51 51 52 //!Different states of a quest.52 //!Different states of a Quest. 53 53 enum Enum 54 54 { … … 65 65 /** 66 66 @brief 67 Represents a quest in the game.68 A quest has a list of subquests and a parentquest (if it is not a rootquest).69 Each quest exists only once but it has a different status (inactive, active, failed or completed) for each player.70 A quest has several hints (QuestHint) that can be unlocked through QuestEffects and then display aid in solving the quest.71 A quest has a list of QuestEffects that are invoked when the quest is failed and also a list of effects that are invoked, when the quest is completed.67 Represents a Quest in the game. 68 A Quest has a list of subquests and a parentquest (if it is not a rootquest). 69 Each Quest exists only once but it has a different status (inactive, active, failed or completed) for each player. 70 A Quest has several hints (QuestHint) that can be unlocked through QuestEffects and then display aid in solving the Quest. 71 A Quest has a list of QuestEffects that are invoked when the quest is failed and also a list of QuestEffects that are invoked, when the Quest is completed. 72 72 73 73 Quest itself should not be instantiated, if you want to create a quest either go for LocalQuest or GlobalQuest, whichever suits you needs better. … … 83 83 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a Quest object through XML. 84 84 85 inline Quest* getParentQuest(void) const //!< Returns the parent quest of the quest. 85 /** 86 @brief Returns the parentquest of the Quest. 87 @return Returns a pointer to the parentquest of the Quest. 88 */ 89 inline Quest* getParentQuest(void) const 86 90 { return this->parentQuest_; } 87 inline const std::list<Quest*> & getSubQuestList(void) const //!< Returns the list of sub quests. 91 92 /** 93 @brief Returns the list of subquests. 94 @return Returns a reference to the list of subquests of the quest. 95 */ 96 inline const std::list<Quest*> & getSubQuestList(void) const 88 97 { return this->subQuests_; } 89 inline const std::list<QuestHint*> & getHintsList(void) const //!< Returns the list of all hints of this quest. 98 99 /** 100 @brief Returns the list of all QuestHints of this Quest. 101 @return Returns a reference to the list of QuestHints of the Quest. 102 */ 103 inline const std::list<QuestHint*> & getHintsList(void) const 90 104 { return this->hints_; } 91 105 … … 95 109 bool isCompleted(const ControllableEntity* player) const; //!< Returns true if the quest status for the specific player is 'completed'. 96 110 97 bool start(ControllableEntity* player); //!< Sets a quest to active.98 virtual bool fail(ControllableEntity* player) = 0; //!< Fails the quest.99 virtual bool complete(ControllableEntity* player) = 0; //!< Completes the quest.111 bool start(ControllableEntity* player); //!< Sets a Quest to active. 112 virtual bool fail(ControllableEntity* player) = 0; //!< Fails the Quest. 113 virtual bool complete(ControllableEntity* player) = 0; //!< Completes the Quest. 100 114 101 115 protected: 102 virtual bool isStartable(const ControllableEntity* player) const = 0; //!< Checks whether the quest can be started.103 virtual bool isFailable(const ControllableEntity* player) const = 0; //!< Checks whether the quest can be failed.104 virtual bool isCompletable(const ControllableEntity* player) const = 0; //!< Checks whether the quest can be completed.116 virtual bool isStartable(const ControllableEntity* player) const = 0; //!< Checks whether the Quest can be started. 117 virtual bool isFailable(const ControllableEntity* player) const = 0; //!< Checks whether the Quest can be failed. 118 virtual bool isCompletable(const ControllableEntity* player) const = 0; //!< Checks whether the Quest can be completed. 105 119 106 const Quest* getParentQuest(void); //!< Returns the parent quest of the quest. 107 const Quest* getSubQuest(unsigned int index) const; //!<Returns the sub quest of the given index. 108 const QuestHint* getHint(unsigned int index) const; //!< Returns the hint of the given index. 109 const QuestEffect* getFailEffect(unsigned int index) const; //!< Returns the failEffect of the given index. 110 const QuestEffect* getCompleteEffect(unsigned int index) const; //!< Returns the completeEffect of the given index. 111 inline std::list<QuestEffect*> & getFailEffectList(void) //!< Returns the list of failEffects. 120 const Quest* getParentQuest(void); //!< Returns the parentquest of the Quest. 121 const Quest* getSubQuest(unsigned int index) const; //!<Returns the subquest at the given index. 122 const QuestHint* getHint(unsigned int index) const; //!< Returns the QuestHint at the given index. 123 const QuestEffect* getFailEffect(unsigned int index) const; //!< Returns the fail QuestEffect at the given index. 124 const QuestEffect* getCompleteEffect(unsigned int index) const; //!< Returns the complete QuestEffect at the given index. 125 126 /** 127 @brief Returns the list of fail QuestEffects. 128 @return Returns a reference to the list of fail QuestEffects. 129 */ 130 inline std::list<QuestEffect*> & getFailEffectList(void) 112 131 { return this->failEffects_; } 113 inline std::list<QuestEffect*> & getCompleteEffectList(void) //!< Returns the list of completeEffects. 132 133 /** 134 @brief Returns the list of complete QuestEffects. 135 @return Returns a reference to the list of complete QuestEffects. 136 */ 137 inline std::list<QuestEffect*> & getCompleteEffectList(void) 114 138 { return this->completeEffects_; } 115 139 116 virtual questStatus::Enum getStatus(const ControllableEntity* player) const = 0; //!< Returns the status of the quest for a specific player.140 virtual questStatus::Enum getStatus(const ControllableEntity* player) const = 0; //!< Returns the status of the Quest for a specific player. 117 141 virtual bool setStatus(ControllableEntity* player, const questStatus::Enum & status) = 0; //!< Changes the status for a specific player. 118 142 119 143 private: 120 Quest* parentQuest_; //!< Pointer to the parent 121 std::list<Quest*> subQuests_; //!< List of all the sub 144 Quest* parentQuest_; //!< Pointer to the parentquest. 145 std::list<Quest*> subQuests_; //!< List of all the subquests. 122 146 123 std::list<QuestHint*> hints_; //!< A list of all the hints tied to this quest.147 std::list<QuestHint*> hints_; //!< A list of all the QuestHints tied to this Quest. 124 148 125 std::list<QuestEffect*> failEffects_; //!< A list of all effects to be invoked, when the quest has been failed.126 std::list<QuestEffect*> completeEffects_; //!< A list of effects to be invoked, when the quest has been completed.149 std::list<QuestEffect*> failEffects_; //!< A list of all QuestEffects to be invoked, when the Quest has been failed. 150 std::list<QuestEffect*> completeEffects_; //!< A list of QuestEffects to be invoked, when the Quest has been completed. 127 151 128 bool setParentQuest(Quest* quest); //!< Sets the parent quest of the quest.129 bool addSubQuest(Quest* quest); //!< Adds a sub quest to the quest.130 bool addHint(QuestHint* hint); //!< Add a hint to the list of hints.131 bool addFailEffect(QuestEffect* effect); //!< Adds an effect to the list of failEffects.132 bool addCompleteEffect(QuestEffect* effect); //!< Adds an effect to the list of completeEffects.152 bool setParentQuest(Quest* quest); //!< Sets the parentquest of the Quest. 153 bool addSubQuest(Quest* quest); //!< Adds a subquest to the Quest. 154 bool addHint(QuestHint* hint); //!< Add a QuestHint to the list of QuestHints. 155 bool addFailEffect(QuestEffect* effect); //!< Adds an QuestEffect to the list of fail QuestEffects. 156 bool addCompleteEffect(QuestEffect* effect); //!< Adds an QuestEffect to the list of complete QuestEffects. 133 157 134 158 }; -
code/branches/questsystem2/src/orxonox/objects/quest/QuestDescription.h
r2159 r2191 60 60 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestDescription object through XML. 61 61 62 inline const std::string & getTitle(void) const //!< Returns the title. 62 /** 63 @brief Returns the title. 64 @return Returns a string containing the title of the QuestDescription. 65 */ 66 inline const std::string & getTitle(void) const 63 67 { return this->title_; } 64 inline const std::string & getDescription(void) const //!< Returns the description text. 68 69 /** 70 @brief Returns the description text. 71 @return Returns a string containing the description text of the QuestDescription. 72 */ 73 inline const std::string & getDescription(void) const 65 74 { return this->description_; } 66 75 … … 69 78 std::string description_; //!< The description. 70 79 71 inline void setTitle(const std::string & title) //!< Sets the title. 80 /** 81 @brief Sets the title. 82 @param title The title to be set. 83 */ 84 inline void setTitle(const std::string & title) 72 85 { this->title_ = title; } 73 inline void setDescription(const std::string & description) //!< Sets the description text. 86 87 /** 88 @brief Sets the description text. 89 @param description The description text to be set. 90 */ 91 inline void setDescription(const std::string & description) 74 92 { this->description_ = description; } 75 93 -
code/branches/questsystem2/src/orxonox/objects/quest/QuestEffect.cc
r2159 r2191 63 63 /** 64 64 @brief 65 Static method. Invoke all effects in an effectlist on a given player.65 Static method. Invoke all QuestEffects in an QuestEffect-list on a given player. 66 66 @param player 67 The player the effects are invoked on.67 The player the QuestEffects are invoked on. 68 68 @param effects 69 A list of all the effects to be invoked.69 A list of all the QuestEffects to be invoked. 70 70 @return 71 71 Returns false if there was an error, view console of log for further detail. -
code/branches/questsystem2/src/orxonox/objects/quest/QuestEffect.h
r2159 r2191 46 46 /** 47 47 @brief 48 Handles effects for quests.49 QuestEffects are the only way for quests to have any sideeffects in the game world. They are also the only way to gain, complete or fail quests.48 Handles QuestEffects for Quests. 49 QuestEffects are the only way for Quests to have any sideeffects in the game world. They are also the only way for a player to gain, complete or fail Quests. 50 50 @author 51 51 Damian 'Mozork' Frick … … 57 57 virtual ~QuestEffect(); 58 58 59 virtual bool invoke(ControllableEntity* player) = 0; //!< Invokes the effect.60 static bool invokeEffects(ControllableEntity* player, std::list<QuestEffect*> & effects); //!< Invokes all effects in the list.59 virtual bool invoke(ControllableEntity* player) = 0; //!< Invokes the QuestEffect. 60 static bool invokeEffects(ControllableEntity* player, std::list<QuestEffect*> & effects); //!< Invokes all QuestEffects in the list. 61 61 62 62 -
code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.cc
r2146 r2191 32 32 #include "core/CoreIncludes.h" 33 33 #include "core/XMLPort.h" 34 #include "core/Event.h" 34 35 35 36 #include "orxonox/objects/worldentities/ControllableEntity.h" 37 #include "orxonox/objects/worldentities/triggers/Trigger.h" 36 38 #include "QuestEffect.h" 37 39 … … 46 48 this->status_ = QuestEffectBeaconStatus::active; 47 49 this->times_ = -1; 50 this->trigger_ = NULL; 48 51 } 49 50 52 51 53 QuestEffectBeacon::~QuestEffectBeacon() … … 58 60 59 61 XMLPortParam(QuestEffectBeacon, "times", setTimes, getTimes, xmlelement, mode); 60 XMLPortObject(QuestEffectBeacon, QuestEffect, "", addEffect, getEffects, xmlelement, mode); 62 XMLPortObject(QuestEffectBeacon, QuestEffect, "", addEffect, getEffect, xmlelement, mode); 63 XMLPortObject(QuestEffectBeacon, Trigger, "", addTrigger, getTrigger, xmlelement, mode); 64 } 65 66 void processEvent(Event& event) 67 { 68 //TDO. Resolve pseudo code. 69 //if(isControllableEntity(event.originator_)) 70 //{ 71 // SetEvent(BaseObject, "activity", execute, event); 72 //} 61 73 } 62 74 … … 93 105 return false; 94 106 } 95 if(this-> times_== -1)107 if(this->getTimes() == -1) 96 108 { 97 109 return true; … … 99 111 100 112 this->times_ = this->times_ - 1; 101 if(this-> times_== 0)113 if(this->getTimes() == 0) 102 114 { 103 115 this->status_ = QuestEffectBeaconStatus::inactive; … … 134 146 this->effects_.push_back(effect); 135 147 136 COUT(3) << "A n effect was added to a QuestEffectBeacon." << std::endl;148 COUT(3) << "A QuestEffect was added to a QuestEffectBeacon." << std::endl; 137 149 return true; 150 } 151 152 bool QuestEffectBeacon::addTrigger(Trigger* trigger) 153 { 154 if(this->trigger_ != NULL) 155 { 156 COUT(2) << "A Trigger was trying to be added, where one was already set." << std::endl; 157 return false; 158 } 159 if(trigger == NULL) 160 { 161 COUT(2) << "A NULL-Trigger was trying to be added." << std::endl; 162 return false; 163 } 164 165 COUT(3) << "A Trigger was added to a QuestEffectBeacon." << std::endl; 166 this->trigger_ = trigger; 167 return true; 138 168 } 139 169 … … 142 172 143 173 */ 144 const QuestEffect* QuestEffectBeacon::getEffect s(unsigned int index) const174 const QuestEffect* QuestEffectBeacon::getEffect(unsigned int index) const 145 175 { 146 176 int i = index; … … 156 186 } 157 187 188 const Trigger* QuestEffectBeacon::getTrigger(unsigned int index) const 189 { 190 if(index == 0) 191 { 192 return this->trigger_; 193 } 194 195 return NULL; 196 } 158 197 159 198 } -
code/branches/questsystem2/src/orxonox/objects/quest/QuestEffectBeacon.h
r2146 r2191 61 61 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 62 62 63 virtual void processEvent(Event& event); 64 63 65 bool execute(ControllableEntity* player); 64 66 … … 66 68 67 69 protected: 70 bool decrementTimes(void); 71 72 inline const int & getTimes(void) const 73 { return this->times_; } 74 75 private: 68 76 std::list<QuestEffect*> effects_; 69 77 int times_; //!< Number of times the beacon can be exectued. 70 78 QuestEffectBeaconStatus::Enum status_; 71 72 bool decrementTimes(void); 79 Trigger* trigger_; 73 80 74 81 bool setTimes(const int & n); 75 82 bool addEffect(QuestEffect* effect); 83 bool addTrigger(Trigger* trigger); 76 84 77 inline const int & getTimes(void) const 78 { return this->times_; } 79 const QuestEffect* getEffects(unsigned int index) const; 85 const QuestEffect* getEffect(unsigned int index) const; 86 const Trigger* getTrigger(unsigned int index) const; 80 87 81 88 }; -
code/branches/questsystem2/src/orxonox/objects/quest/QuestHint.cc
r2159 r2191 78 78 /** 79 79 @brief 80 Checks whether the hint is active for a specific player.80 Checks whether the QuestHint is active for a specific player. 81 81 @param player 82 82 The player. … … 84 84 Throws an Argument Exception if the input Player-pointer is NULL. 85 85 @return 86 Returns true if the hint is active for the specified player.86 Returns true if the QuestHint is active for the specified player. 87 87 */ 88 88 bool QuestHint::isActive(ControllableEntity* player) … … 134 134 /** 135 135 @brief 136 Sets the quest the QuestHitnbelongs to.136 Sets the Quest the QuestHint belongs to. 137 137 @param quest 138 The quest to be set as quest the hint is attached to.138 The Quest to be set as Quest the QuestHint is attached to. 139 139 @return 140 140 Returns true if successful. -
code/branches/questsystem2/src/orxonox/objects/quest/QuestHint.h
r2159 r2191 62 62 @brief 63 63 Represents a hint in the game towards completing a Quest. 64 Consists of title and description in textual form and must belong to a quest.65 A QuestHi t has a defined status (inactive or active, where inactive is default) for each player, which means eachQuestHint exists only once for all players, it doesn't belong to a player, it just has different states for each of them.64 Consists of title and description (which is stored in a QuestDescription object) in textual form and must belong to a quest. 65 A QuestHint has a defined status (inactive or active, where inactive is default) for each player, which means each a QuestHint exists only once for all players, it doesn't belong to a player, it just has different states for each of them. 66 66 67 67 Creating a QuestHint through XML goes as follows: … … 82 82 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestHint object through XML. 83 83 84 bool isActive(ControllableEntity* player); //!< Returns true if the hint is active for the input player.84 bool isActive(ControllableEntity* player); //!< Returns true if the QuestHint is active for the input player. 85 85 86 bool setActive(ControllableEntity* player); //!< Activates the hint for the input player.87 bool setQuest(Quest* quest); //!< Sets the quest the hint belongs to.86 bool setActive(ControllableEntity* player); //!< Activates the QuestHint for the input player. 87 bool setQuest(Quest* quest); //!< Sets the Quest the QuestHint belongs to. 88 88 89 inline Quest* getQuest(void) //!< Returns the quest the hint is attached to. 89 /** 90 @brief Returns the Quest the QuestHint is attached to. 91 @return Returns a pointer to the Quest the QuestHint is attached to. 92 */ 93 inline Quest* getQuest(void) 90 94 { return this->quest_; } 91 95 92 96 private: 93 Quest* quest_; //!< The quest the hint belongs to.97 Quest* quest_; //!< The Quest the QuestHint belongs to. 94 98 std::map<ControllableEntity*, questHintStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key. 95 99 -
code/branches/questsystem2/src/orxonox/objects/quest/QuestItem.h
r2159 r2191 51 51 /** 52 52 @brief 53 Functions as a base class for Quest classes such as Quest or QuestHint.53 Functions as a base class for quest classes such as Quest or QuestHint. 54 54 Has a unique identifier and a description. 55 55 @author … … 65 65 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestItem object through XML. 66 66 67 inline const std::string & getId(void) const //!< Returns the id of this quest. 67 /** 68 @brief Returns the id of this QuestItem. 69 @return Returns the id of the QuestItem. 70 */ 71 inline const std::string & getId(void) const 68 72 { return this->id_; } 69 inline const QuestDescription* getDescription(void) const //!< Returns the description of the QuestItem. 73 /** 74 @brief Returns the QuestDescription of the QuestItem. 75 @return Returns a pointer to the QuestDescription object of the QuestItem. 76 */ 77 inline const QuestDescription* getDescription(void) const 70 78 { return this->description_; } 71 79 … … 74 82 protected: 75 83 void setId(const std::string & id); //!< Sets the id of the QuestItem. 76 inline void setDescription(QuestDescription* description) //!< Sets the description of the QuestItem. 84 85 /** 86 @brief Sets the description of the QuestItem. 87 @param description The QuestDescription to be set. 88 */ 89 inline void setDescription(QuestDescription* description) 77 90 { this->description_ = description; } 78 91 79 92 private: 80 93 std::string id_; //!< Identifier. Should be of GUID form: http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure 81 QuestDescription* description_; //!< The description of the QuestItem.94 QuestDescription* description_; //!< The QuestDescription of the QuestItem. 82 95 83 96 }; -
code/branches/questsystem2/src/orxonox/objects/quest/QuestManager.cc
r2159 r2191 44 44 namespace orxonox { 45 45 46 //! All quests registered by their id's.46 //! All Quests registered by their id's. 47 47 std::map<std::string, Quest*> QuestManager::questMap_s; 48 //! All hints registered by their id's.48 //! All QuestHints registered by their id's. 49 49 std::map<std::string, QuestHint*> QuestManager::hintMap_s; 50 50 … … 69 69 /** 70 70 @brief 71 Registers a quest with the QuestManager to make it globally accessable.71 Registers a Quest with the QuestManager to make it globally accessable. 72 72 Uses it's id to make sure to be able to be identify and retrieve it later. 73 73 @param quest 74 The quest that is to be registered.74 The Quest that is to be registered. 75 75 @return 76 76 Returns true if successful, false if not. … … 85 85 86 86 std::pair<std::map<std::string, Quest*>::iterator,bool> result; 87 result = questMap_s.insert( std::pair<std::string,Quest*>(quest->getId(),quest) ); //!< Inserting the quest.87 result = questMap_s.insert( std::pair<std::string,Quest*>(quest->getId(),quest) ); //!< Inserting the Quest. 88 88 89 89 if(result.second) //!< If inserting was a success. … … 117 117 118 118 std::pair<std::map<std::string, QuestHint*>::iterator,bool> result; 119 result = hintMap_s.insert ( std::pair<std::string,QuestHint*>(hint->getId(),hint) ); //!< Inserting the hint.119 result = hintMap_s.insert ( std::pair<std::string,QuestHint*>(hint->getId(),hint) ); //!< Inserting the QuestHSint. 120 120 121 121 if(result.second) //!< If inserting was a success. … … 133 133 /** 134 134 @brief 135 Finds a quest with the given id.135 Finds a Quest with the given id. 136 136 @param questId 137 The id of the quest sought for.138 @return 139 Returns a reference to the quest with the input id.140 Returns NULL if there is no quest with the given questId.137 The id of the Quest sought for. 138 @return 139 Returns a pointer to the Quest with the input id. 140 Returns NULL if there is no Quest with the given questId. 141 141 @throws 142 142 Throws an exception if the given questId is invalid. … … 151 151 Quest* quest; 152 152 std::map<std::string, Quest*>::iterator it = questMap_s.find(questId); 153 if (it != questMap_s.end()) //!< If the quest is registered.153 if (it != questMap_s.end()) //!< If the Quest is registered. 154 154 { 155 155 quest = it->second; … … 167 167 /** 168 168 @brief 169 Finds a hint with the given id.169 Finds a QuestHint with the given id. 170 170 @param hintId 171 The id of the hint sought for.172 @return 173 Returns a reference to the hint with the input id.174 Returns NULL if there is no hint with the given hintId.171 The id of the QuestHint sought for. 172 @return 173 Returns a pointer to the QuestHint with the input id. 174 Returns NULL if there is no QuestHint with the given hintId. 175 175 @throws 176 176 Throws an exception if the given hintId is invalid. … … 185 185 QuestHint* hint; 186 186 std::map<std::string, QuestHint*>::iterator it = hintMap_s.find(hintId); 187 if (it != hintMap_s.end()) //!< If the hint is registered.187 if (it != hintMap_s.end()) //!< If the QuestHint is registered. 188 188 { 189 189 hint = it->second; -
code/branches/questsystem2/src/orxonox/objects/quest/QuestManager.h
r2159 r2191 47 47 /** 48 48 @brief 49 Is a static class and manages quests, by registering every quest/hint (through registerX()) and making them globally accessable (through findX()).50 Quests (and Hints) are registered in the QuestManager with their id, and can be accessed in the same way.49 Is a static class and manages Quests, by registering every Quest/QuestHint (through registerX()) and making them globally accessable (through findX()). 50 Quests (and QuestHints) are registered in the QuestManager with their id, and can be accessed in the same way. 51 51 @author 52 52 Damian 'Mozork' Frick … … 59 59 virtual ~QuestManager(); 60 60 61 static bool registerQuest(Quest* quest); //!< Registers a quest in the QuestManager.61 static bool registerQuest(Quest* quest); //!< Registers a Quest in the QuestManager. 62 62 static bool registerHint(QuestHint* quest); //!< Registers a QuestHint in the QuestManager. 63 63 64 static Quest* findQuest(const std::string & questId); //!< Returns the quest with the input id.64 static Quest* findQuest(const std::string & questId); //!< Returns the Quest with the input id. 65 65 static QuestHint* findHint(const std::string & hintId); //!< Returns the QuestHint with the input id. 66 66 67 67 private: 68 static std::map<std::string, Quest*> questMap_s; //!< All quests registered by their id's.69 static std::map<std::string, QuestHint*> hintMap_s; //!< All hints registered by their id's.68 static std::map<std::string, Quest*> questMap_s; //!< All Quests registered by their id's. 69 static std::map<std::string, QuestHint*> hintMap_s; //!< All QuestHints registered by their id's. 70 70 71 71 };
Note: See TracChangeset
for help on using the changeset viewer.