Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 14, 2009, 3:07:59 AM (15 years ago)
Author:
landauf
Message:

sorry, large commit, but all changes are dependent:

  • Created a new plugin for the questsystem (called just "quest" for the moment because I'd had to rename the directory otherwise (the tolua script enforces this))
  • Added QuestPrereqs.h file and _QuestExport macro
  • Moved the GUI-name ↔ PlayerInfo map from QuestManager to GUIManager
  • Moved NotificationOverlay and NotificationQueue from overlays to quest and linked the overlays plugin into the quest plugin
  • Made QuestManager and NotificationManager ScopedSingletons with ScopeID GSLevel. Also removed both singletons from GSLevel and added the Scope instance instead.
File:
1 edited

Legend:

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

    r5617 r5648  
    3535#define _QuestManager_H__
    3636
    37 #include "OrxonoxPrereqs.h"
     37#include "objects/quest/QuestPrereqs.h"
    3838
    3939#include <list>
     
    4141#include <string>
    4242
    43 #include "util/Singleton.h"
     43#include "util/ScopedSingleton.h"
    4444#include "core/OrxonoxClass.h"
    4545
     
    6666    };
    6767
     68    typedef ScopedSingleton<QuestManager, ScopeID::GSLevel> ScopedSingletonQuestManagerGSLevel; // workaround for tolua
     69
    6870    /**
    6971    @brief
     
    7375        Damian 'Mozork' Frick
    7476    */
    75     class _OrxonoxExport QuestManager : public Singleton<QuestManager>, public orxonox::OrxonoxClass
     77    class _QuestExport QuestManager : public ScopedSingletonQuestManagerGSLevel, public orxonox::OrxonoxClass
    7678    {
    7779// tolua_end
    78             friend class Singleton<QuestManager>;
     80            friend class ScopedSingleton<QuestManager, ScopeID::GSLevel>;
    7981        public:
    8082            QuestManager();
     
    8284
    8385            //! Returns a reference to the single instance of the Quest Manager.
    84             static QuestManager& getInstance() { return Singleton<QuestManager>::getInstance(); } // tolua_export
     86            static QuestManager& getInstance() { return ScopedSingleton<QuestManager, ScopeID::GSLevel>::getInstance(); } // tolua_export
    8587
    8688            bool registerQuest(Quest* quest); //!< Registers a Quest in the QuestManager.
     
    9294            QuestContainer* getQuestTree(std::string & name); // tolua_export
    9395
    94             inline void setPlayer(const std::string& guiname, PlayerInfo* player)
    95                 { this->players_[guiname] = player; }
    96             inline PlayerInfo* getPlayer(const std::string& guiname) const
    97                 { std::map<std::string, PlayerInfo*>::const_iterator it = this->players_.find(guiname); return (it != this->players_.end()) ? it->second : 0; }
    98 
    9996        private:
    10097            static QuestManager* singletonPtr_s;
     
    10299            std::map<std::string, Quest*> questMap_; //!< All Quests registered by their id's.
    103100            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 gui
    105101
    106102            void getRootQuests(const PlayerInfo* player, std::list<Quest*> & list);
Note: See TracChangeset for help on using the changeset viewer.