- Timestamp:
- Oct 30, 2008, 9:52:12 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem/src/orxonox/objects/GlobalQuest.cc
r2043 r2068 28 28 29 29 #include "core/CoreIncludes.h" 30 #include "util/Exception.h" 30 31 31 32 #include "GlobalQuest.h" … … 35 36 CreateFactory(GlobalQuest); 36 37 38 /** 39 @brief 40 Constructor. 41 */ 37 42 GlobalQuest::GlobalQuest() : Quest() 38 43 { 39 44 this->initialize(); 40 45 } 41 46 … … 50 55 The description of the quest. 51 56 */ 52 GlobalQuest::GlobalQuest(std::string id , std::string title, std::string description) : Quest(id, title, description)57 GlobalQuest::GlobalQuest(std::string id) : Quest(id) 53 58 { 54 RegisterObject(GlobalQuest);59 this->initialize(); 55 60 } 56 61 … … 64 69 } 65 70 71 void GlobalQuest::initialize(void) 72 { 73 RegisterObject(GlobalQuest); 74 } 75 66 76 /** 67 77 @brief … … 71 81 @return 72 82 Returns true if the quest can be started, false if not. 83 @throws 84 Throws an exception if either isInactive() of isActive() throws one. 73 85 */ 74 86 bool GlobalQuest::isStartable(const Player* player) const 75 87 { 76 return this->isInactive(player) || this->isActive(player);88 return this->isInactive(player) || this->isActive(player); 77 89 } 78 90 … … 84 96 @return 85 97 Returns true if the quest can be failed, false if not. 98 @throws 99 Throws an Exception if isActive() throws one. 86 100 */ 87 101 bool GlobalQuest::isFailable(const Player* player) const 88 102 { 89 103 return this->isActive(player); 104 90 105 } 91 106 … … 97 112 @return 98 113 Returns true if the quest can be completed, false if not. 114 @throws 115 Throws an Exception if isActive() throws one. 99 116 */ 100 117 bool GlobalQuest::isCompletable(const Player* player) const … … 108 125 @param player 109 126 The player. 127 @throws 128 Throws an Exception if player is NULL. 110 129 */ 111 130 questStatus::Enum GlobalQuest::getStatus(const Player* player) const 112 131 { 132 if(player == NULL) 133 { 134 ThrowException(Argument, "The input Player* is NULL."); 135 } 136 113 137 //TDO: Does this really work??? 114 138 std::set<Player*>::const_iterator it = this->players_.find((Player*)(void*)player); … … 127 151 @brief 128 152 Sets the status for a specific player. 153 But be careful wit this one, the status will just be set without checking for its validity. You have to know what you're doing. 129 154 @param player 130 155 The player. 131 156 @param status 132 157 The status to be set. 158 @return 159 Returns false if player is NULL. 133 160 */ 134 161 bool GlobalQuest::setStatus(Player* player, const questStatus::Enum & status) 135 162 { 163 if(player == NULL) 164 { 165 return false; 166 } 167 136 168 std::set<Player*>::const_iterator it = this->players_.find(player); 137 169 if (it == this->players_.end()) //!< Player is not yet in the list.
Note: See TracChangeset
for help on using the changeset viewer.