Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 23, 2009, 8:45:56 PM (14 years ago)
Author:
rgrieder
Message:

Mood changes should now be working and with immediate (but delayed because of loading) effect.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/MoodManager.h

    r6370 r6406  
    3232#include "OrxonoxPrereqs.h"
    3333
    34 #include <cassert>
    35 #include <list>
    3634#include <string>
    37 
    3835#include "util/Singleton.h"
    3936#include "core/OrxonoxClass.h"
    4037
    41 // tolua_begin
    4238namespace orxonox
    4339{
    44     class _OrxonoxExport MoodManager
    45     // tolua_end
    46         : public Singleton<MoodManager>, public OrxonoxClass
    47     { // tolua_export
     40    class _OrxonoxExport MoodListener : virtual public OrxonoxClass
     41    {
     42        friend class MoodManager;
     43
     44        protected:
     45            MoodListener();
     46            virtual ~MoodListener() {}
     47
     48            const std::string& getMood() const { return mood_s; }
     49
     50        private:
     51            virtual void moodChanged(const std::string& mood) = 0;
     52
     53            static void changedMood(const std::string& mood);
     54            static std::string mood_s;
     55    };
     56
     57    class _OrxonoxExport MoodManager : public Singleton<MoodManager>, public OrxonoxClass
     58    {
    4859            friend class Singleton<MoodManager>;
    4960        public:
    5061            MoodManager();
    51             ~MoodManager();
    5262
    5363            void setConfigValues();
    5464
    5565            void setMood(const std::string& mood);
    56             const std::string& getMood();
     66            inline const std::string& getMood() const { return this->mood_; }
    5767
    58             static MoodManager& getInstance() { return Singleton<MoodManager>::getInstance(); } // tolua_export
     68            static MoodManager& getInstance() { return Singleton<MoodManager>::getInstance(); }
    5969
    6070        private:
     71            ~MoodManager() {}
    6172            void checkMoodValidity();
    6273
    6374            // config values
    6475            std::string mood_;
    65             std::string moodOld_;
    6676
    6777            static MoodManager* singletonPtr_s;
    68     }; // tolua_export
    69 } // tolua_export
     78    };
     79}
    7080
    7181#endif /* _MoodManager_H__ */
Note: See TracChangeset for help on using the changeset viewer.