- 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/LocalQuest.h
r2096 r2146 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 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(ControllableEntity* player); //!< Fails the quest. 90 virtual bool complete(ControllableEntity* 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 ControllableEntity* player) const; //!< Checks whether the quest can be started. 94 virtual bool isFailable(const ControllableEntity* player) const; //!< Checks whether the quest can be failed. 95 virtual bool isCompletable(const ControllableEntity* 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 ControllableEntity* player) const; //!< Returns the status of the quest for a specific player. 98 virtual bool setStatus(ControllableEntity* 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.101 std::map<ControllableEntity*, questStatus::Enum> playerStatus_; //!< List of the status for each player, with the Player-pointer as key. 68 102 69 void initialize(void); 103 void initialize(void); //!< Initializes the object. 70 104 71 105 }; 72 73 106 74 107 }
Note: See TracChangeset
for help on using the changeset viewer.