Changeset 2261 for code/trunk/src/orxonox/objects/quest/GlobalQuest.h
- Timestamp:
- Nov 25, 2008, 11:56:40 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/questsystem2 (added) merged: 2109,2146,2159,2191,2193-2196,2205-2206,2208-2209,2221,2226,2228,2251,2258
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/quest/GlobalQuest.h
- Property svn:mergeinfo changed
/code/branches/questsystem2/src/orxonox/objects/quest/GlobalQuest.h (added) merged: 2146,2159,2191,2205,2226,2251 /code/trunk/src/orxonox/objects/quest/GlobalQuest.h merged: 1925-2089
r2096 r2261 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 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. 50 GlobalQuests are Quests, that have the same status for all players. 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(PlayerInfo* player); //!< Fails the Quest. 95 virtual bool complete(PlayerInfo* 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 PlayerInfo* player) const; //!< Checks whether the Quest can be started. 99 virtual bool isFailable(const PlayerInfo* player) const; //!< Checks whether the Quest can be failed. 100 virtual bool isCompletable(const PlayerInfo* 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 PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player. 103 104 virtual bool setStatus(PlayerInfo* player, const questStatus::Enum & status); //!< Sets the status for a specific player. 65 105 66 106 private: 67 std::set<Player*> players_; //!< The set of players which possess this quest. 68 questStatus::Enum status_; //!< The status of this quest. 69 70 void initialize(void); 107 std::set<PlayerInfo*> players_; //!< The set of players which possess this Quest. 108 questStatus::Enum status_; //!< The status of this Quest. 109 std::list<QuestEffect*> rewards_; //!< Reward QuestEffects only invoked on the player completing the Quest. 110 111 bool addRewardEffect(QuestEffect* effect); //!< Adds a reward QuestEffect to the list of reward QuestEffects. 112 const QuestEffect* getRewardEffects(unsigned int index) const; //!< Returns the reward QuestEffect at the given index. 71 113 72 114 }; - Property svn:mergeinfo changed
Note: See TracChangeset
for help on using the changeset viewer.