Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8449 for code


Ignore:
Timestamp:
May 11, 2011, 10:55:30 PM (14 years ago)
Author:
dafrick
Message:

Moving the Notification class int NotificationManager, since it is only a container now.

Location:
code/branches/tutoriallevel2/src/modules/notifications
Files:
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tutoriallevel2/src/modules/notifications/CMakeLists.txt

    r8446 r8449  
    11SET_SOURCE_FILES(NOTIFICATIONS_SRC_FILES
    2   Notification.cc
    32  NotificationDispatcher.cc
    43  NotificationManager.cc
  • code/branches/tutoriallevel2/src/modules/notifications/NotificationManager.cc

    r8448 r8449  
    4141#include "interfaces/NotificationListener.h"
    4242
    43 #include "Notification.h"
    4443#include "NotificationQueue.h"
    4544#include "NotificationQueueCEGUI.h"
     
    424423    }
    425424
     425    // Notification class
     426
     427    /**
     428    @brief
     429        Constructor. Creates a Notification with the input message and sender.
     430    @param message
     431        The message of the Notification.
     432    @param sender
     433        The sender of the Notification.
     434    @param type
     435
     436    */
     437    Notification::Notification(const std::string& message, const std::string& sender, notificationMessageType::Value type)
     438    {
     439        this->initialize();
     440        this->message_ = message;
     441        this->sender_ = sender;
     442        this->type_ = type;
     443    }
     444
     445    /**
     446    @brief
     447        Destructor.
     448    */
     449    Notification::~Notification()
     450    {
     451
     452    }
     453
     454    /**
     455    @brief
     456        Registers the object and sets some default values.
     457    */
     458    void Notification::initialize(void)
     459    {
     460        this->message_.clear();
     461        this->sender_ = NotificationListener::NONE;
     462    }
     463
    426464}
  • code/branches/tutoriallevel2/src/modules/notifications/NotificationManager.h

    r8448 r8449  
    4242#include <string>
    4343
     44#include "core/OrxonoxClass.h"
    4445#include "util/Singleton.h"
    4546#include "interfaces/NotificationListener.h"
     
    4748namespace orxonox // tolua_export
    4849{ // tolua_export
     50
     51    /**
     52    @brief
     53        A Notification represents a short message used to inform the player about something that just happened. With the @ref orxonox::NotificationManager "NotificationManager" a Notification can be sent from any part of orxonox and is then displayed by the proper @ref orxonox::NotificationQueue "NotificationQueue(s)" (depending on which senders the specific @ref orxonox::NotificationQueue "NotificationQueues" accepts).
     54
     55        A Notification is just a data structure that is used internally by the Notifications module.
     56
     57    @author
     58        Damian 'Mozork' Frick
     59
     60    @ingroup Notifications
     61    */
     62    class _NotificationsExport Notification
     63    {
     64        public:
     65            Notification(const std::string& message, const std::string& sender, notificationMessageType::Value type);
     66            virtual ~Notification();
     67
     68            /**
     69            @brief Destroys the Notification.
     70            */
     71            void destroy(void)
     72                { delete this; }
     73
     74            /**
     75            @brief Get the message of the Notification.
     76            @return Returns the message of the Notification.
     77            */
     78            inline const std::string & getMessage(void) const
     79                { return this->message_; }
     80
     81            /**
     82            @brief Get the sender of the Notification.
     83            @return Returns the sender of the Notification.
     84            */
     85            inline const std::string & getSender(void) const
     86                { return this->sender_; }
     87
     88            /**
     89            @brief Get the type of the Notification.
     90            @return Returns an enum with the type of the Notification.
     91            */
     92            inline notificationMessageType::Value getType(void) const
     93                { return this->type_; }
     94
     95        private:
     96            std::string message_; //!< The Notification message.
     97            std::string sender_; //!< The sender of the notification.
     98            notificationMessageType::Value type_; //!< The type of the notification.
     99
     100            void initialize(void); //!< Registers the object and sets some default values.
     101
     102    };
    49103
    50104    /**
  • code/branches/tutoriallevel2/src/modules/notifications/NotificationQueue.cc

    r8448 r8449  
    3939#include "core/CoreIncludes.h"
    4040#include "util/SubString.h"
    41 
    42 #include "Notification.h"
    4341
    4442namespace orxonox
  • code/branches/tutoriallevel2/src/modules/notifications/NotificationQueueCEGUI.cc

    r8448 r8449  
    4141#include "core/LuaState.h"
    4242#include "util/Convert.h"
    43 
    44 #include "Notification.h"
    4543
    4644#include "ToluaBindNotifications.h"
Note: See TracChangeset for help on using the changeset viewer.