- Timestamp:
- Oct 27, 2008, 8:31:20 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem/src/orxonox/objects/GlobalQuest.cc
r1996 r2021 35 35 CreateFactory(GlobalQuest); 36 36 37 GlobalQuest::GlobalQuest() : Quest() 38 { 39 40 } 41 37 42 /** 38 43 @brief … … 45 50 The description of the quest. 46 51 */ 47 GlobalQuest::GlobalQuest(std::string id, std::string title = "", std::string description = "") : Quest(id, title, description)52 GlobalQuest::GlobalQuest(std::string id, std::string title, std::string description) : Quest(id, title, description) 48 53 { 49 54 RegisterObject(GlobalQuest); … … 67 72 Returns true if the quest can be started, false if not. 68 73 */ 69 bool GlobalQuest::isStartable( const Player & player) const74 bool GlobalQuest::isStartable(Player* player) 70 75 { 71 76 return this->isInactive(player) || this->isActive(player); … … 80 85 Returns true if the quest can be failed, false if not. 81 86 */ 82 bool GlobalQuest::isFailable( const Player & player) const87 bool GlobalQuest::isFailable(Player* player) 83 88 { 84 89 return this->isActive(player); … … 93 98 Returns true if the quest can be completed, false if not. 94 99 */ 95 bool GlobalQuest::isCompletable( const Player & player) const100 bool GlobalQuest::isCompletable(Player* player) 96 101 { 97 102 return this->isActive(player); … … 104 109 The player. 105 110 */ 106 questStatus::Enum getStatus(const Player & player) const111 questStatus::Enum GlobalQuest::getStatus(const Player* player) 107 112 { 108 113 //TDO: Does this really work??? 109 if (this->players_.find(&player) != this->players_.end()) 114 std::set<Player*>::const_iterator it = this->players_.find((Player*)(void*)player); 115 if (it != this->players_.end()) 110 116 { 111 117 return this->status_; … … 126 132 The status to be set. 127 133 */ 128 void setStatus(const Player &player, const questStatus::Enum & status)134 bool GlobalQuest::setStatus(Player* player, const questStatus::Enum & status) 129 135 { 130 if (this->players_.find(&player) == this->players_.end()) //!< Player is not yet in the list. 136 std::set<Player*>::const_iterator it = this->players_.find(player); 137 if (it == this->players_.end()) //!< Player is not yet in the list. 131 138 { 132 this->players_.insert( &player);139 this->players_.insert(player); 133 140 } 134 141 this->status_ = status; 142 return true; 135 143 } 136 144
Note: See TracChangeset
for help on using the changeset viewer.