Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 8, 2009, 1:07:27 AM (15 years ago)
Author:
dafrick
Message:

Merging the QuestSystem branch to the trunk. Let's hope, this isn't a 'third time's the charm'-thing…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/objects/quest/QuestManager.h

    r2896 r2909  
    2828
    2929/**
    30     @file
     30    @file QuestManager.h
    3131    @brief Definition of the QuestManager class.
    3232*/
     
    4040#include <string>
    4141
    42 #include "core/BaseObject.h"
     42#include "core/OrxonoxClass.h"
    4343
    4444namespace orxonox
     
    4646    /**
    4747    @brief
    48         Is a static class and 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()).
    4949        Quests (and QuestHints) are registered in the QuestManager with their id, and can be accessed in the same way.
    5050    @author
    5151        Damian 'Mozork' Frick
    5252    */
    53     class _OrxonoxExport QuestManager : public BaseObject
     53    class _OrxonoxExport QuestManager : public OrxonoxClass
    5454    {
    55 
    5655        public:
    57             QuestManager(BaseObject* creator);
     56            QuestManager();
    5857            virtual ~QuestManager();
    5958
    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.
    6260
    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.
    6566
    6667        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.
    6972
    7073    };
Note: See TracChangeset for help on using the changeset viewer.