- Timestamp:
- Aug 14, 2009, 3:07:59 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/libraries/src/orxonox/objects/quest/QuestManager.h
r5617 r5648 35 35 #define _QuestManager_H__ 36 36 37 #include " OrxonoxPrereqs.h"37 #include "objects/quest/QuestPrereqs.h" 38 38 39 39 #include <list> … … 41 41 #include <string> 42 42 43 #include "util/S ingleton.h"43 #include "util/ScopedSingleton.h" 44 44 #include "core/OrxonoxClass.h" 45 45 … … 66 66 }; 67 67 68 typedef ScopedSingleton<QuestManager, ScopeID::GSLevel> ScopedSingletonQuestManagerGSLevel; // workaround for tolua 69 68 70 /** 69 71 @brief … … 73 75 Damian 'Mozork' Frick 74 76 */ 75 class _ OrxonoxExport QuestManager : public Singleton<QuestManager>, public orxonox::OrxonoxClass77 class _QuestExport QuestManager : public ScopedSingletonQuestManagerGSLevel, public orxonox::OrxonoxClass 76 78 { 77 79 // tolua_end 78 friend class S ingleton<QuestManager>;80 friend class ScopedSingleton<QuestManager, ScopeID::GSLevel>; 79 81 public: 80 82 QuestManager(); … … 82 84 83 85 //! Returns a reference to the single instance of the Quest Manager. 84 static QuestManager& getInstance() { return S ingleton<QuestManager>::getInstance(); } // tolua_export86 static QuestManager& getInstance() { return ScopedSingleton<QuestManager, ScopeID::GSLevel>::getInstance(); } // tolua_export 85 87 86 88 bool registerQuest(Quest* quest); //!< Registers a Quest in the QuestManager. … … 92 94 QuestContainer* getQuestTree(std::string & name); // tolua_export 93 95 94 inline void setPlayer(const std::string& guiname, PlayerInfo* player)95 { this->players_[guiname] = player; }96 inline PlayerInfo* getPlayer(const std::string& guiname) const97 { std::map<std::string, PlayerInfo*>::const_iterator it = this->players_.find(guiname); return (it != this->players_.end()) ? it->second : 0; }98 99 96 private: 100 97 static QuestManager* singletonPtr_s; … … 102 99 std::map<std::string, Quest*> questMap_; //!< All Quests registered by their id's. 103 100 std::map<std::string, QuestHint*> hintMap_; //!< All QuestHints registered by their id's. 104 std::map<std::string, PlayerInfo*> players_; //!< Stores the player (owner) for each gui105 101 106 102 void getRootQuests(const PlayerInfo* player, std::list<Quest*> & list);
Note: See TracChangeset
for help on using the changeset viewer.