Changeset 2909 for code/trunk/src/orxonox/objects/quest/QuestManager.h
- Timestamp:
- Apr 8, 2009, 1:07:27 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/objects/quest/QuestManager.h
r2896 r2909 28 28 29 29 /** 30 @file 30 @file QuestManager.h 31 31 @brief Definition of the QuestManager class. 32 32 */ … … 40 40 #include <string> 41 41 42 #include "core/ BaseObject.h"42 #include "core/OrxonoxClass.h" 43 43 44 44 namespace orxonox … … 46 46 /** 47 47 @brief 48 Is a static classand manages Quests, by registering every Quest/QuestHint (through registerX()) and making them globally accessable (through findX()).48 Is a Singleton and manages Quests, by registering every Quest/QuestHint (through registerX()) and making them globally accessable (through findX()). 49 49 Quests (and QuestHints) are registered in the QuestManager with their id, and can be accessed in the same way. 50 50 @author 51 51 Damian 'Mozork' Frick 52 52 */ 53 class _OrxonoxExport QuestManager : public BaseObject53 class _OrxonoxExport QuestManager : public OrxonoxClass 54 54 { 55 56 55 public: 57 QuestManager( BaseObject* creator);56 QuestManager(); 58 57 virtual ~QuestManager(); 59 58 60 static bool registerQuest(Quest* quest); //!< Registers a Quest in the QuestManager. 61 static bool registerHint(QuestHint* quest); //!< Registers a QuestHint in the QuestManager. 59 static QuestManager& getInstance(); //!< Returns a reference to the single instance of the Quest Manager. 62 60 63 static Quest* findQuest(const std::string & questId); //!< Returns the Quest with the input id. 64 static QuestHint* findHint(const std::string & hintId); //!< Returns the QuestHint with the input id. 61 bool registerQuest(Quest* quest); //!< Registers a Quest in the QuestManager. 62 bool registerHint(QuestHint* quest); //!< Registers a QuestHint in the QuestManager. 63 64 Quest* findQuest(const std::string & questId); //!< Returns the Quest with the input id. 65 QuestHint* findHint(const std::string & hintId); //!< Returns the QuestHint with the input id. 65 66 66 67 private: 67 static std::map<std::string, Quest*> questMap_s; //!< All Quests registered by their id's. 68 static std::map<std::string, QuestHint*> hintMap_s; //!< All QuestHints registered by their id's. 68 static QuestManager* singletonRef_s; 69 70 std::map<std::string, Quest*> questMap_; //!< All Quests registered by their id's. 71 std::map<std::string, QuestHint*> hintMap_; //!< All QuestHints registered by their id's. 69 72 70 73 };
Note: See TracChangeset
for help on using the changeset viewer.