Changeset 5745 for code/trunk/src/modules/questsystem/QuestManager.h
- Timestamp:
- Sep 13, 2009, 3:04:02 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/questsystem/QuestManager.h
r5738 r5745 36 36 37 37 #include "questsystem/QuestsystemPrereqs.h" 38 #include <CEGUIForwardRefs.h> 38 39 39 40 #include <list> … … 44 45 #include "core/OrxonoxClass.h" 45 46 47 #include "QuestGUI.h" 48 46 49 // tolua_begin 47 50 namespace orxonox 48 51 { 49 50 struct QuestContainer;51 struct HintContainer;52 53 struct QuestContainer54 {55 const QuestDescription* description;56 std::string status;57 HintContainer* hint;58 QuestContainer* subQuests;59 QuestContainer* next;60 };61 62 struct HintContainer63 {64 const QuestDescription* description;65 HintContainer* next;66 };67 52 68 53 typedef ScopedSingleton<QuestManager, ScopeID::GSLevel> ScopedSingletonQuestManagerGSLevel; // workaround for tolua … … 78 63 { 79 64 // tolua_end 65 80 66 friend class ScopedSingleton<QuestManager, ScopeID::GSLevel>; 67 friend class QuestGUI; //TDO: better solution. 68 //friend std::map<std::string, Quest*> & QuestGUI::getQuests(void); 69 81 70 public: 82 71 QuestManager(); … … 86 75 static QuestManager& getInstance() { return ScopedSingleton<QuestManager, ScopeID::GSLevel>::getInstance(); } // tolua_export 87 76 77 //! Retreive the main window for the GUI. 78 CEGUI::Window* getQuestGUI(const std::string & guiName); // tolua_export 79 88 80 bool registerQuest(Quest* quest); //!< Registers a Quest in the QuestManager. 89 81 bool registerHint(QuestHint* quest); //!< Registers a QuestHint in the QuestManager. … … 92 84 QuestHint* findHint(const std::string & hintId); //!< Returns the QuestHint with the input id. 93 85 94 QuestContainer* getQuestTree(std::string & name); // tolua_export 86 protected: 87 std::map<std::string, Quest*> & getQuests(void); //!< Retreive all Quests. 95 88 96 89 private: 97 90 static QuestManager* singletonPtr_s; 91 PlayerInfo* retreivePlayer(const std::string & guiName); //!< Retrieve the player for a certain GUI. 98 92 99 93 std::map<std::string, Quest*> questMap_; //!< All Quests registered by their id's. 100 94 std::map<std::string, QuestHint*> hintMap_; //!< All QuestHints registered by their id's. 101 95 102 void getRootQuests(const PlayerInfo* player, std::list<Quest*> & list); 103 HintContainer* addHints(Quest* quest, const PlayerInfo* player); 104 QuestContainer* addSubQuest(Quest* quest, const PlayerInfo* player); 96 //TDO: Call destructor of QuestGUI's on destruction of QuestManager? 97 std::map<PlayerInfo*, QuestGUI*> questGUIs_; //!< All GUI's registered by the players. 105 98 106 99 }; // tolua_export
Note: See TracChangeset
for help on using the changeset viewer.