Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 10, 2011, 11:37:22 PM (13 years ago)
Author:
dafrick
Message:

NotificationListener is new an entity which is informed of new notifications. The NotificationManager is, so far, the only NotificationListener. This means that Notifications can now be sent from within orxonox (though not libraries or external).
Also introduced notification commands to affect the NotificationQueues in more ways than just have them display messages (e.g. clearing them).
Added a message type which allows to send Notifications of different importance, allowing the NotificationQueus to display them differently.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tutoriallevel2/src/modules/notifications/Notification.h

    r8374 r8445  
    4040#include <string>
    4141#include "core/OrxonoxClass.h"
     42#include "interfaces/NotificationListener.h"
    4243
    4344namespace orxonox
     
    4849        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).
    4950
    50         A Notification is just a datastructure that is used internally by the Notifications module.
     51        A Notification is just a data structure that is used internally by the Notifications module.
    5152
    5253    @author
     
    5859    {
    5960        public:
    60             Notification(const std::string& message, const std::string& sender);
     61            Notification(const std::string& message, const std::string& sender, notificationMessageType::Value type);
    6162            virtual ~Notification();
    6263
     
    7576                { return this->sender_; }
    7677
     78            /**
     79            @brief Get the type of the Notification.
     80            @return Returns an enum with the type of the Notification.
     81            */
     82            inline notificationMessageType::Value getType(void) const
     83                { return this->type_; }
     84
    7785        private:
    7886            std::string message_; //!< The Notification message.
    7987            std::string sender_; //!< The sender of the notification.
     88            notificationMessageType::Value type_; //!< The type of the notification.
    8089
    8190            void initialize(void); //!< Registers the object and sets some default values.
Note: See TracChangeset for help on using the changeset viewer.