- Timestamp:
- Oct 30, 2008, 9:52:12 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem/src/orxonox/objects/LocalQuest.cc
r2043 r2068 28 28 29 29 #include "core/CoreIncludes.h" 30 #include "util/Exception.h" 30 31 31 32 #include "LocalQuest.h" … … 37 38 LocalQuest::LocalQuest() : Quest() 38 39 { 39 40 this->initialize(); 40 41 } 41 42 … … 45 46 @param id 46 47 The unique identifier. 47 @param title48 The title of the quest.49 @param description50 The description of the quest.51 48 */ 52 LocalQuest::LocalQuest(std::string id , std::string title, std::string description) : Quest(id, title, description)49 LocalQuest::LocalQuest(std::string id) : Quest(id) 53 50 { 54 RegisterObject(LocalQuest);51 this->initialize(); 55 52 } 56 53 … … 64 61 } 65 62 63 void LocalQuest::initialize(void) 64 { 65 RegisterObject(LocalQuest); 66 } 67 66 68 /** 67 69 @brief … … 71 73 @return 72 74 Returns true if the quest can be started, false if not. 75 @throws 76 Throws an exception if isInactive(Player*) throws one. 73 77 */ 74 78 bool LocalQuest::isStartable(const Player* player) const … … 84 88 @return 85 89 Returns true if the quest can be failed, false if not. 90 @throws 91 Throws an exception if isActive(Player*) throws one. 86 92 */ 87 93 bool LocalQuest::isFailable(const Player* player) const … … 97 103 @return 98 104 Returns true if the quest can be completed, false if not. 105 @throws 106 Throws an exception if isInactive(Player*) throws one. 99 107 */ 100 108 bool LocalQuest::isCompletable(const Player* player) const … … 110 118 @return 111 119 Returns the status of the quest for the input player. 120 @throws 121 Throws an Exception if player is NULL. 112 122 */ 113 123 questStatus::Enum LocalQuest::getStatus(const Player* player) const 114 124 { 125 if(player == NULL) 126 { 127 ThrowException(Argument, "The input Player* is NULL."); 128 } 129 115 130 std::map<Player*, questStatus::Enum>::const_iterator it = this->playerStatus_.find((Player*)(void*)player); //Thx. to x3n for the (Player*)(void*) 'hack'. 116 131 if (it != this->playerStatus_.end()) … … 124 139 @brief 125 140 Sets the status for a specific player. 141 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. 126 142 @param player 127 143 The player. 128 144 @param status 129 145 The status. 146 @return 147 Returns false if player is NULL. 130 148 */ 131 149 bool LocalQuest::setStatus(Player* player, const questStatus::Enum & status) 132 150 { 151 if(player == NULL) 152 { 153 return false; 154 } 133 155 this->playerStatus_[player] = status; 134 156 return true;
Note: See TracChangeset
for help on using the changeset viewer.