Changeset 1996 for code/branches/questsystem/src/orxonox/objects/Quest.h
- Timestamp:
- Oct 22, 2008, 4:03:10 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem/src/orxonox/objects/Quest.h
r1992 r1996 33 33 #include <string> 34 34 35 #include " orxonox/quests/QuestDescription.h"35 #include "QuestDescription.h" 36 36 #include "QuestItem.h" 37 37 #include "QuestHint.h" … … 52 52 public: 53 53 Quest(std::string id, std::string title = "", std::string description = ""); 54 ~Quest();54 virtual ~Quest(); 55 55 56 56 inline Quest* getParentQuest(void) const //!< Returns the parent quest of the quest. … … 60 60 61 61 //TDO: Necessary? Shouldn't this be decided whilest creating the object? 62 inline void setParentQuest(Quest* quest) //!< Sets the parent quest of the quest. 63 { this->parentQuest_ = quest; } 64 inline void addSubQuest(Quest & quest) //!< Adds a sub quest to the quest. 65 { this->subQuests_.push_back = quest; } 62 bool setParentQuest(Quest* quest); //!< Sets the parent quest of the quest. 63 bool addSubQuest(Quest & quest); //!< Adds a sub quest to the quest. 66 64 67 65 inline bool isInactive(const Player & player) const //!< Returns true if the quest status for the specific player is 'inactive'. 68 { return this->getStatus(player) != questStatus::inactive; }66 { return this->getStatus(player) == questStatus::inactive; } 69 67 inline bool isActive(const Player & player) const //!< Returns true if the quest status for the specific player is 'active'. 70 68 { return this->getStatus(player) == questStatus::active; } … … 74 72 { return this->getStatus(player) == questStatus::completed; } 75 73 76 void start(const Player & player); //!< Sets a quest to pending.77 voidfail(Player & player); //!< Fails the quest.78 voidcomplete(Player & player); //!< Completes the quest.74 bool start(const Player & player); //!< Sets a quest to active. 75 bool fail(Player & player); //!< Fails the quest. 76 bool complete(Player & player); //!< Completes the quest. 79 77 80 78 void addHint(QuestHint & hint); //!< Add a hint to the list of hints. … … 82 80 protected: 83 81 void initialize(void); //!< Initialized the object. 82 83 virtual bool isStartable(const Player & player) const = 0; //!< Checks whether the quest can be started. 84 virtual bool isFailable(const Player & player) const = 0; //!< Checks whether the quest can be failed. 85 virtual bool isCompletable(const Player & player) const = 0; //!< Checks whether the quest can be completed. 84 86 85 87 virtual questStatus::Enum getStatus(const Player & player) const = 0; //!< Returns the status of the quest for a specific player.
Note: See TracChangeset
for help on using the changeset viewer.