Changeset 2068 for code/branches/questsystem/src/orxonox/objects/Quest.h
- Timestamp:
- Oct 30, 2008, 9:52:12 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem/src/orxonox/objects/Quest.h
r2043 r2068 58 58 @brief 59 59 Represents a quest in the game. 60 A quest has a sub61 60 A quest has a list of subquests and a parentquest (if it is not a rootquest). 61 Each quest exists only once but it has a different status (inactive, active, failed or completed) for each player. 62 62 @author 63 63 Damian 'Mozork' Frick … … 67 67 public: 68 68 Quest(); 69 Quest(std::string id , std::string title = "", std::string description = "");69 Quest(std::string id); 70 70 virtual ~Quest(); 71 71 … … 75 75 { return this->subQuests_; } 76 76 77 //TDO: Necessary? Shouldn't this be decided whilest creating the object? 78 // Yes it absolutely should and will. Add these methods to protected then? 79 bool setParentQuest(Quest* quest); //!< Sets the parent quest of the quest. 80 bool addSubQuest(Quest* quest); //!< Adds a sub quest to the quest. 81 82 inline bool isInactive(const Player* player) const //!< Returns true if the quest status for the specific player is 'inactive'. 83 { return this->getStatus(player) == questStatus::inactive; } 84 inline bool isActive(const Player* player) const //!< Returns true if the quest status for the specific player is 'active'. 85 { return this->getStatus(player) == questStatus::active; } 86 inline bool isFailed(const Player* player) const //!< Returns true if the quest status for the specific player is 'failed'. 87 { return this->getStatus(player) == questStatus::failed; } 88 inline bool isCompleted(const Player* player) const //!< Returns true if the quest status for the specific player is 'completed'. 89 { return this->getStatus(player) == questStatus::completed; } 77 bool isInactive(const Player* player) const; //!< Returns true if the quest status for the specific player is 'inactive'. 78 bool isActive(const Player* player) const; //!< Returns true if the quest status for the specific player is 'active'. 79 bool isFailed(const Player* player) const; //!< Returns true if the quest status for the specific player is 'failed'. 80 bool isCompleted(const Player* player) const; //!< Returns true if the quest status for the specific player is 'completed'. 90 81 91 82 bool start(Player* player); //!< Sets a quest to active. … … 93 84 bool complete(Player* player); //!< Completes the quest. 94 85 95 voidaddHint(QuestHint* hint); //!< Add a hint to the list of hints.86 bool addHint(QuestHint* hint); //!< Add a hint to the list of hints. 96 87 97 88 protected: … … 102 93 virtual bool isCompletable(const Player* player) const = 0; //!< Checks whether the quest can be completed. 103 94 104 //TDO: Get the parameter const... 95 bool setParentQuest(Quest* quest); //!< Sets the parent quest of the quest. 96 bool addSubQuest(Quest* quest); //!< Adds a sub quest to the quest. 97 105 98 virtual questStatus::Enum getStatus(const Player* player) const = 0; //!< Returns the status of the quest for a specific player. 106 99 virtual bool setStatus(Player* player, const questStatus::Enum & status) = 0; //!< Changes the status for a specific player.
Note: See TracChangeset
for help on using the changeset viewer.