- 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/GlobalQuest.h
r2096 r2146 26 26 * 27 27 */ 28 29 /** 30 @file GlobalQuest.h 31 @brief 32 Definition of the GlobalQuest class. 33 */ 28 34 29 35 #ifndef _GlobalQuest_H__ … … 33 39 34 40 #include <set> 41 #include <list> 35 42 36 43 #include "core/XMLPort.h" … … 39 46 namespace orxonox { 40 47 41 class Player; //Forward declaration, remove when fully integrated into the objecthirarchy.42 43 48 /** 44 49 @brief 45 50 Global quests are quests, that have the same status for all players. 46 This means, that when a player successfully completes this quest, it is completed for all players that have it. 51 This means, that when a player successfully completes a GlobalQuest, it is completed for all players that have it. 52 53 Creating a GlobalQuest through XML goes as follows: 54 55 <GlobalQuest id="questId"> //Where questId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information 56 <QuestDescription title="Title" description="Description." /> //The description of the quest. 57 <subquests> 58 <Quest id ="questId1" /> //A list of n subquest, be aware, each of the <Quest /> tags must have a description and so on and so forth as well. 59 ... 60 <Quest id="questIdn" /> 61 </subquests> 62 <hints> 63 <QuestHint id="hintId1" /> //A list of n QuestHints, see QuestHint for the full XML representation of those. 64 ... 65 <QuestHint id="hintIdn" /> 66 </hints> 67 <fail-effects> 68 <QuestEffect /> //A list of QuestEffects, invoked on all players possessing this quest, when the Quest is failed, see QuestEffect for the full XML representation. 69 ... 70 <QuestEffect /> 71 </fail-effects> 72 <complete-effects> 73 <QuestEffect /> //A list of QuestEffects, invoked on all players possessing this quest, when the Quest is completed, see QuestEffect for the full XML representation. 74 ... 75 <QuestEffect /> 76 </complete-effects> 77 <reward-effects> 78 <QuestEffect /> //A list of QuestEffects, invoked on the player completing this quest. See QuestEffect for the full XML representation. 79 ... 80 <QuestEffect /> 81 </reward-effects> 82 </GlobalQuest> 47 83 @author 48 84 Damian 'Mozork' Frick … … 54 90 virtual ~GlobalQuest(); 55 91 56 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 92 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a GlobalQuest object through XML. 93 94 virtual bool fail(ControllableEntity* player); //!< Fails the quest. 95 virtual bool complete(ControllableEntity* player); //!< Completes the quest. 57 96 58 97 protected: 59 virtual bool isStartable(const Player* player) const; //!< Checks whether the quest can be started.60 virtual bool isFailable(const Player* player) const; //!< Checks whether the quest can be failed.61 virtual bool isCompletable(const Player* player) const; //!< Checks whether the quest can be completed.98 virtual bool isStartable(const ControllableEntity* player) const; //!< Checks whether the quest can be started. 99 virtual bool isFailable(const ControllableEntity* player) const; //!< Checks whether the quest can be failed. 100 virtual bool isCompletable(const ControllableEntity* player) const; //!< Checks whether the quest can be completed. 62 101 63 virtual questStatus::Enum getStatus(const Player* player) const; //!< Returns the status of the quest for a specific player.64 virtual bool setStatus( Player* player, const questStatus::Enum & status); //!< Sets the status for a specific player.102 virtual questStatus::Enum getStatus(const ControllableEntity* player) const; //!< Returns the status of the quest for a specific player. 103 virtual bool setStatus(ControllableEntity* player, const questStatus::Enum & status); //!< Sets the status for a specific player. 65 104 66 105 private: 67 std::set< Player*> players_; //!< The set of players which possess this quest.106 std::set<ControllableEntity*> players_; //!< The set of players which possess this quest. 68 107 questStatus::Enum status_; //!< The status of this quest. 108 std::list<QuestEffect*> rewards_; //!< Reward effects only invoked on the player completing the quest. 109 110 bool addRewardEffect(QuestEffect* effect); //!< Adds a reward effect to the list of reward effects. 111 const QuestEffect* getRewardEffects(unsigned int index) const; //!< Returns the reward effect at the given index. 69 112 70 void initialize(void); 113 void initialize(void); //!< Initializes the object. 71 114 72 115 };
Note: See TracChangeset
for help on using the changeset viewer.