Changeset 2261 for code/trunk/src/orxonox/objects/quest/LocalQuest.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/LocalQuest.h
- Property svn:mergeinfo changed
/code/branches/questsystem2/src/orxonox/objects/quest/LocalQuest.h (added) merged: 2146,2159,2191,2205,2251 /code/trunk/src/orxonox/objects/quest/LocalQuest.h merged: 1925-2089
r2096 r2261 26 26 * 27 27 */ 28 29 /** 30 @file LocalQuest.h 31 @brief 32 Definition of the LocalQuest class. 33 */ 28 34 29 35 #ifndef _LocalQuest_H__ … … 40 46 namespace orxonox { 41 47 42 class Player; //Forward declaration, remove when fully integrated into the objecthirarchy.43 44 48 /** 45 49 @brief 46 Handles quests which have different states for different players. 50 Handles Quests which have different states for different players. 51 LocalQuests have (as opposed to GlobalQuests) a different state for each player, that means if for one player the status of the Quest changes it does not for all the other players which also possess this quest. 52 53 Creating a LocalQuest through XML goes as follows: 54 55 <LocalQuest 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 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 when the Quest is completed, see QuestEffect for the full XML representation. 74 ... 75 <QuestEffect /> 76 </complete-effects> 77 </LocalQuest> 47 78 @author 48 79 Damian 'Mozork' Frick … … 54 85 virtual ~LocalQuest(); 55 86 56 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 87 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a LocalQuest object through XML. 88 89 virtual bool fail(PlayerInfo* player); //!< Fails the Quest. 90 virtual bool complete(PlayerInfo* player); //!< Completes the Quest. 57 91 58 92 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.93 virtual bool isStartable(const PlayerInfo* player) const; //!< Checks whether the Quest can be started. 94 virtual bool isFailable(const PlayerInfo* player) const; //!< Checks whether the Quest can be failed. 95 virtual bool isCompletable(const PlayerInfo* player) const; //!< Checks whether the Quest can be completed. 62 96 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.97 virtual questStatus::Enum getStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player. 98 virtual bool setStatus(PlayerInfo* player, const questStatus::Enum & status); //!< Sets the status for a specific player. 65 99 66 100 private: 67 std::map<Player*, questStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key. 68 69 void initialize(void); 101 std::map<const PlayerInfo*, questStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key. 70 102 71 103 }; 72 73 104 74 105 } - Property svn:mergeinfo changed
Note: See TracChangeset
for help on using the changeset viewer.