Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 13, 2009, 3:04:02 PM (15 years ago)
Author:
dafrick
Message:

QuestGUI almost working…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/questsystem/QuestManager.h

    r5738 r5745  
    3636
    3737#include "questsystem/QuestsystemPrereqs.h"
     38#include <CEGUIForwardRefs.h>
    3839
    3940#include <list>
     
    4445#include "core/OrxonoxClass.h"
    4546
     47#include "QuestGUI.h"
     48
    4649// tolua_begin
    4750namespace orxonox
    4851{
    49 
    50     struct QuestContainer;
    51     struct HintContainer;
    52 
    53     struct QuestContainer
    54     {
    55         const QuestDescription* description;
    56         std::string status;
    57         HintContainer* hint;
    58         QuestContainer* subQuests;
    59         QuestContainer* next;
    60     };
    61 
    62     struct HintContainer
    63     {
    64         const QuestDescription* description;
    65         HintContainer* next;
    66     };
    6752
    6853    typedef ScopedSingleton<QuestManager, ScopeID::GSLevel> ScopedSingletonQuestManagerGSLevel; // workaround for tolua
     
    7863    {
    7964// tolua_end
     65
    8066            friend class ScopedSingleton<QuestManager, ScopeID::GSLevel>;
     67            friend class QuestGUI; //TDO: better solution.
     68            //friend std::map<std::string, Quest*> & QuestGUI::getQuests(void);
     69
    8170        public:
    8271            QuestManager();
     
    8675            static QuestManager& getInstance() { return ScopedSingleton<QuestManager, ScopeID::GSLevel>::getInstance(); } // tolua_export
    8776
     77            //! Retreive the main window for the GUI.
     78            CEGUI::Window* getQuestGUI(const std::string & guiName); // tolua_export
     79
    8880            bool registerQuest(Quest* quest); //!< Registers a Quest in the QuestManager.
    8981            bool registerHint(QuestHint* quest); //!< Registers a QuestHint in the QuestManager.
     
    9284            QuestHint* findHint(const std::string & hintId); //!< Returns the QuestHint with the input id.
    9385
    94             QuestContainer* getQuestTree(std::string & name); // tolua_export
     86        protected:
     87            std::map<std::string, Quest*> & getQuests(void); //!< Retreive all Quests.
    9588
    9689        private:
    9790            static QuestManager* singletonPtr_s;
     91            PlayerInfo* retreivePlayer(const std::string & guiName); //!< Retrieve the player for a certain GUI.
    9892
    9993            std::map<std::string, Quest*> questMap_; //!< All Quests registered by their id's.
    10094            std::map<std::string, QuestHint*> hintMap_; //!< All QuestHints registered by their id's.
    10195
    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.
    10598
    10699    }; // tolua_export
Note: See TracChangeset for help on using the changeset viewer.