Changeset 2043 for code/branches/questsystem/src/orxonox/objects
- Timestamp:
- Oct 29, 2008, 8:34:59 AM (16 years ago)
- Location:
- code/branches/questsystem/src/orxonox/objects
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem/src/orxonox/objects/GlobalQuest.cc
r2021 r2043 72 72 Returns true if the quest can be started, false if not. 73 73 */ 74 bool GlobalQuest::isStartable( Player* player)74 bool GlobalQuest::isStartable(const Player* player) const 75 75 { 76 76 return this->isInactive(player) || this->isActive(player); … … 85 85 Returns true if the quest can be failed, false if not. 86 86 */ 87 bool GlobalQuest::isFailable( Player* player)87 bool GlobalQuest::isFailable(const Player* player) const 88 88 { 89 89 return this->isActive(player); … … 98 98 Returns true if the quest can be completed, false if not. 99 99 */ 100 bool GlobalQuest::isCompletable( Player* player)100 bool GlobalQuest::isCompletable(const Player* player) const 101 101 { 102 102 return this->isActive(player); … … 109 109 The player. 110 110 */ 111 questStatus::Enum GlobalQuest::getStatus(const Player* player) 111 questStatus::Enum GlobalQuest::getStatus(const Player* player) const 112 112 { 113 113 //TDO: Does this really work??? -
code/branches/questsystem/src/orxonox/objects/GlobalQuest.h
r2021 r2043 53 53 54 54 protected: 55 virtual bool isStartable( Player* player); //!< Checks whether the quest can be started.56 virtual bool isFailable( Player* player); //!< Checks whether the quest can be failed.57 virtual bool isCompletable( Player* player); //!< Checks whether the quest can be completed.55 virtual bool isStartable(const Player* player) const; //!< Checks whether the quest can be started. 56 virtual bool isFailable(const Player* player) const; //!< Checks whether the quest can be failed. 57 virtual bool isCompletable(const Player* player) const; //!< Checks whether the quest can be completed. 58 58 59 virtual questStatus::Enum getStatus(const Player* player) ; //!< Returns the status of the quest for a specific player.59 virtual questStatus::Enum getStatus(const Player* player) const; //!< Returns the status of the quest for a specific player. 60 60 virtual bool setStatus(Player* player, const questStatus::Enum & status); //!< Sets the status for a specific player. 61 61 -
code/branches/questsystem/src/orxonox/objects/LocalQuest.cc
r2021 r2043 72 72 Returns true if the quest can be started, false if not. 73 73 */ 74 bool LocalQuest::isStartable( Player* player)74 bool LocalQuest::isStartable(const Player* player) const 75 75 { 76 76 return this->isInactive(player); … … 85 85 Returns true if the quest can be failed, false if not. 86 86 */ 87 bool LocalQuest::isFailable( Player* player)87 bool LocalQuest::isFailable(const Player* player) const 88 88 { 89 89 return this->isActive(player); … … 98 98 Returns true if the quest can be completed, false if not. 99 99 */ 100 bool LocalQuest::isCompletable( Player* player)100 bool LocalQuest::isCompletable(const Player* player) const 101 101 { 102 102 return this->isActive(player); … … 111 111 Returns the status of the quest for the input player. 112 112 */ 113 questStatus::Enum LocalQuest::getStatus(const Player* player) 113 questStatus::Enum LocalQuest::getStatus(const Player* player) const 114 114 { 115 115 std::map<Player*, questStatus::Enum>::const_iterator it = this->playerStatus_.find((Player*)(void*)player); //Thx. to x3n for the (Player*)(void*) 'hack'. -
code/branches/questsystem/src/orxonox/objects/LocalQuest.h
r2021 r2043 53 53 54 54 protected: 55 virtual bool isStartable( Player* player); //!< Checks whether the quest can be started.56 virtual bool isFailable( Player* player); //!< Checks whether the quest can be failed.57 virtual bool isCompletable( Player* player); //!< Checks whether the quest can be completed.55 virtual bool isStartable(const Player* player) const; //!< Checks whether the quest can be started. 56 virtual bool isFailable(const Player* player) const; //!< Checks whether the quest can be failed. 57 virtual bool isCompletable(const Player* player) const; //!< Checks whether the quest can be completed. 58 58 59 virtual questStatus::Enum getStatus(const Player* player) ; //!< Returns the status of the quest for a specific player.59 virtual questStatus::Enum getStatus(const Player* player) const; //!< Returns the status of the quest for a specific player. 60 60 virtual bool setStatus(Player* player, const questStatus::Enum & status); //!< Sets the status for a specific player. 61 61 -
code/branches/questsystem/src/orxonox/objects/Quest.h
r2021 r2043 80 80 bool addSubQuest(Quest* quest); //!< Adds a sub quest to the quest. 81 81 82 inline bool isInactive( Player* player)//!< Returns true if the quest status for the specific player is 'inactive'.82 inline bool isInactive(const Player* player) const //!< Returns true if the quest status for the specific player is 'inactive'. 83 83 { return this->getStatus(player) == questStatus::inactive; } 84 inline bool isActive( Player* player)//!< Returns true if the quest status for the specific player is 'active'.84 inline bool isActive(const Player* player) const //!< Returns true if the quest status for the specific player is 'active'. 85 85 { return this->getStatus(player) == questStatus::active; } 86 inline bool isFailed( Player* player)//!< Returns true if the quest status for the specific player is 'failed'.86 inline bool isFailed(const Player* player) const //!< Returns true if the quest status for the specific player is 'failed'. 87 87 { return this->getStatus(player) == questStatus::failed; } 88 inline bool isCompleted( Player* player)//!< Returns true if the quest status for the specific player is 'completed'.88 inline bool isCompleted(const Player* player) const //!< Returns true if the quest status for the specific player is 'completed'. 89 89 { return this->getStatus(player) == questStatus::completed; } 90 90 … … 98 98 void initialize(void); //!< Initialized the object. 99 99 100 virtual bool isStartable( Player* player)= 0; //!< Checks whether the quest can be started.101 virtual bool isFailable( Player* player)= 0; //!< Checks whether the quest can be failed.102 virtual bool isCompletable( Player* player)= 0; //!< Checks whether the quest can be completed.100 virtual bool isStartable(const Player* player) const = 0; //!< Checks whether the quest can be started. 101 virtual bool isFailable(const Player* player) const = 0; //!< Checks whether the quest can be failed. 102 virtual bool isCompletable(const Player* player) const = 0; //!< Checks whether the quest can be completed. 103 103 104 104 //TDO: Get the parameter const... 105 virtual questStatus::Enum getStatus(const Player* player) = 0; //!< Returns the status of the quest for a specific player.105 virtual questStatus::Enum getStatus(const Player* player) const = 0; //!< Returns the status of the quest for a specific player. 106 106 virtual bool setStatus(Player* player, const questStatus::Enum & status) = 0; //!< Changes the status for a specific player. 107 107 -
code/branches/questsystem/src/orxonox/objects/Rewardable.cc
r2021 r2043 33 33 namespace orxonox { 34 34 35 CreateFactory(Rewardable);36 37 35 Rewardable::Rewardable() : BaseObject() 38 36 {
Note: See TracChangeset
for help on using the changeset viewer.