Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 8, 2009, 2:58:40 AM (15 years ago)
Author:
landauf
Message:

Merged r1-2096 of questsystem5 back to trunk

I hope there weren't more "hidden merge changes" in r2909 than the one in OverlayGroup (removeElement) (and related to this the adjustments in NotificationQueue).

The corresponding media commit seems not yet to be done, but it doesn't break the build.

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/objects/quest/QuestManager.h

    r2910 r2911  
    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.