Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2786


Ignore:
Timestamp:
Mar 15, 2009, 12:55:45 PM (16 years ago)
Author:
dafrick
Message:

Some changes to QuestManager and NotificationManager by Reto's request. (Make them more consistent as Singletons)

Location:
code/branches/questsystem5/src/orxonox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem5/src/orxonox/gamestates/GSLevel.cc

    r2759 r2786  
    4646#include "LevelManager.h"
    4747#include "PlayerManager.h"
     48#include "objects/quest/QuestManager.h"
     49#include "overlays/notifications/NotificationManager.h"
    4850
    4951namespace orxonox
     
    9597
    9698        this->playerManager_ = new PlayerManager();
     99
     100        this->questManager_ = new QuestManager();
     101
     102        this->notificationManager_ = new NotificationManager();
    97103
    98104        if (Core::isMaster())
  • code/branches/questsystem5/src/orxonox/gamestates/GSLevel.h

    r2710 r2786  
    6363        LevelManager*         levelManager_;
    6464        PlayerManager*        playerManager_;
     65        QuestManager*          questManager_;
     66        NotificationManager*  notificationManager_;
    6567
    6668        //##### ConfigValues #####
  • code/branches/questsystem5/src/orxonox/objects/quest/QuestManager.cc

    r2785 r2786  
    5656        RegisterRootObject(QuestManager);
    5757
     58        assert(singletonRef_s == 0);
     59        singletonRef_s = this;
    5860    }
    5961
     
    7577    /*static*/ QuestManager & QuestManager::getInstance()
    7678    {
    77         if(singletonRef_s == NULL)
    78         {
    79             singletonRef_s = new QuestManager();
    80         }
     79        assert(singletonRef_s);
    8180        return *singletonRef_s;
    8281    }
  • code/branches/questsystem5/src/orxonox/objects/quest/QuestManager.h

    r2785 r2786  
    5353    class _OrxonoxExport QuestManager : public BaseObject
    5454    {
    55 
    56         protected:
     55        public:
    5756            QuestManager();
    58 
    59         public:
    6057            virtual ~QuestManager();
    6158
  • code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationManager.cc

    r2785 r2786  
    5858        RegisterRootObject(NotificationManager);
    5959
     60        assert(singletonRef_s == 0);
     61        singletonRef_s = this;
     62
    6063        this->highestIndex_ = 0;
    6164    }
     
    7780    /*static*/ NotificationManager & NotificationManager::getInstance()
    7881    {
    79         if(singletonRef_s == NULL)
    80         {
    81             singletonRef_s = new NotificationManager();
    82         }
     82        assert(singletonRef_s);
    8383        return *singletonRef_s;
    8484    }
  • code/branches/questsystem5/src/orxonox/overlays/notifications/NotificationManager.h

    r2785 r2786  
    5757    class _OrxonoxExport NotificationManager : public BaseObject
    5858    {
    59         protected:
     59        public:
    6060            NotificationManager();
    61 
    62         public:
    6361            virtual ~NotificationManager();
    6462               
Note: See TracChangeset for help on using the changeset viewer.