- Timestamp:
- Nov 6, 2008, 12:02:05 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem2/src/orxonox/objects/quest/Quest.h
r2096 r2146 26 26 * 27 27 */ 28 28 29 /** 30 @file Quest.h 31 @brief 32 Definition of the Quest class. 33 34 The Quest is the parent class of LocalQuest and GlobalQuest. 35 */ 36 29 37 #ifndef _Quest_H__ 30 38 #define _Quest_H__ … … 38 46 #include "QuestItem.h" 39 47 48 40 49 namespace questStatus 41 50 { 42 51 52 //!Different states of a quest. 43 53 enum Enum 44 54 { … … 53 63 namespace orxonox { 54 64 55 class Player; //Forward declaration, remove when fully integrated into the objecthirarchy.56 57 65 /** 58 66 @brief … … 60 68 A quest has a list of subquests and a parentquest (if it is not a rootquest). 61 69 Each quest exists only once but it has a different status (inactive, active, failed or completed) for each player. 70 A quest has several hints (QuestHint) that can be unlocked through QuestEffects and then display aid in solving the quest. 71 A quest has a list of QuestEffects that are invoked when the quest is failed and also a list of effects that are invoked, when the quest is completed. 72 73 Quest itself should not be instantiated, if you want to create a quest either go for LocalQuest or GlobalQuest, whichever suits you needs better. 62 74 @author 63 75 Damian 'Mozork' Frick … … 69 81 virtual ~Quest(); 70 82 71 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 83 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a Quest object through XML. 72 84 73 85 inline Quest* getParentQuest(void) const //!< Returns the parent quest of the quest. … … 76 88 { return this->subQuests_; } 77 89 78 bool isInactive(const Player* player) const; //!< Returns true if the quest status for the specific player is 'inactive'.79 bool isActive(const Player* player) const; //!< Returns true if the quest status for the specific player is 'active'.80 bool isFailed(const Player* player) const; //!< Returns true if the quest status for the specific player is 'failed'.81 bool isCompleted(const Player* player) const; //!< Returns true if the quest status for the specific player is 'completed'.90 bool isInactive(const ControllableEntity* player) const; //!< Returns true if the quest status for the specific player is 'inactive'. 91 bool isActive(const ControllableEntity* player) const; //!< Returns true if the quest status for the specific player is 'active'. 92 bool isFailed(const ControllableEntity* player) const; //!< Returns true if the quest status for the specific player is 'failed'. 93 bool isCompleted(const ControllableEntity* player) const; //!< Returns true if the quest status for the specific player is 'completed'. 82 94 83 bool start( Player* player); //!< Sets a quest to active.84 bool fail(Player* player); //!< Fails the quest.85 bool complete(Player* player); //!< Completes the quest.95 bool start(ControllableEntity* player); //!< Sets a quest to active. 96 virtual bool fail(ControllableEntity* player) = 0; //!< Fails the quest. 97 virtual bool complete(ControllableEntity* player) = 0; //!< Completes the quest. 86 98 87 99 protected: 88 void initialize(void); //!< Initialize dthe object.100 void initialize(void); //!< Initializes the object. 89 101 90 virtual bool isStartable(const Player* player) const = 0; //!< Checks whether the quest can be started.91 virtual bool isFailable(const Player* player) const = 0; //!< Checks whether the quest can be failed.92 virtual bool isCompletable(const Player* player) const = 0; //!< Checks whether the quest can be completed.102 virtual bool isStartable(const ControllableEntity* player) const = 0; //!< Checks whether the quest can be started. 103 virtual bool isFailable(const ControllableEntity* player) const = 0; //!< Checks whether the quest can be failed. 104 virtual bool isCompletable(const ControllableEntity* player) const = 0; //!< Checks whether the quest can be completed. 93 105 94 106 bool setParentQuest(Quest* quest); //!< Sets the parent quest of the quest. 95 107 bool addSubQuest(Quest* quest); //!< Adds a sub quest to the quest. 96 108 bool addHint(QuestHint* hint); //!< Add a hint to the list of hints. 97 bool addFailEffect(QuestEffect* effect); 98 bool addCompleteEffect(QuestEffect* effect); 109 bool addFailEffect(QuestEffect* effect); //!< Adds an effect to the list of failEffects. 110 bool addCompleteEffect(QuestEffect* effect); //!< Adds an effect to the list of completeEffects. 99 111 100 const Quest* getParentQuest(void); 101 const Quest* getSubQuests(unsigned int index) const; 102 const QuestHint* getHints(unsigned int index) const; 103 const QuestEffect* getFailEffects(unsigned int index) const; 104 const QuestEffect* getCompleteEffects(unsigned int index) const; 112 const Quest* getParentQuest(void); //!< Returns the parent quest of the quest. 113 const Quest* getSubQuests(unsigned int index) const; //!<Returns the sub quest of the given index. 114 const QuestHint* getHints(unsigned int index) const; //!< Returns the hint of the given index. 115 const QuestEffect* getFailEffects(unsigned int index) const; //!< Returns the failEffect of the given index. 116 const QuestEffect* getCompleteEffects(unsigned int index) const; //!Returns the completeEffect of the given index. 105 117 106 virtual questStatus::Enum getStatus(const Player* player) const = 0; //!< Returns the status of the quest for a specific player.107 virtual bool setStatus( Player* player, const questStatus::Enum & status) = 0; //!< Changes the status for a specific player.118 virtual questStatus::Enum getStatus(const ControllableEntity* player) const = 0; //!< Returns the status of the quest for a specific player. 119 virtual bool setStatus(ControllableEntity* player, const questStatus::Enum & status) = 0; //!< Changes the status for a specific player. 108 120 109 121 Quest* parentQuest_; //!< Pointer to the parent quest.
Note: See TracChangeset
for help on using the changeset viewer.