Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 9, 2010, 10:59:01 PM (14 years ago)
Author:
dafrick
Message:

Finished EditMode, needs some polish (no not the language…) though.
Took better advantage of lua tables in NotificationLayer.lua
Fixed a lot of bugs, it really is a miracle that the Notifications worked as well as they did.

File:
1 edited

Legend:

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

    r7354 r7395  
    4646#include "NotificationManager.h"
    4747
    48 namespace orxonox
    49 {
     48namespace orxonox // tolua_export
     49{ // tolua_export
    5050
    5151    //! Container to allow easy handling.
     
    6868        Damian 'Mozork' Frick
    6969    */
    70     class _NotificationsExport NotificationQueue : public Tickable, public NotificationListener
    71     {
     70    class _NotificationsExport NotificationQueue // tolua_export
     71        : public Tickable, public NotificationListener
     72    { // tolua_export
    7273
    7374        public:
     
    8081            void update(Notification* notification, const std::time_t & time); //!< Adds a Notification to the queue.
    8182
     83            // tolua_begin
    8284            /**
    8385            @brief Get the name of the NotificationQueue.
     
    8789                { return this->name_; }
    8890
     91            void setMaxSize(unsigned int size); //!< Sets the maximum number of displayed Notifications.
    8992            /**
    9093            @brief Returns the maximum number of Notifications displayed.
     
    9396            inline unsigned int getMaxSize() const
    9497                { return this->maxSize_; }
     98
     99            void setDisplayTime(unsigned int time); //!< Sets the maximum number of seconds a Notification is displayed.
     100            /**
     101            @brief Returns the time interval the Notification is displayed.
     102            @return Returns the display time.
     103            */
     104            inline float getDisplayTime() const
     105                { return this->displayTime_; }
     106            // tolua_end
     107
    95108            /**
    96109            @brief Returns the current number of Notifications displayed.
     
    99112            inline unsigned int getSize() const
    100113                { return this->size_; }
    101             /**
    102             @brief Returns the time interval the Notification is displayed.
    103             @return Returns the display time.
    104             */
    105             inline float getDisplayTime() const
    106                 { return this->displayTime_; }
    107114
    108115            /**
     
    110117            @return Retuns a set of string holding the different targets.
    111118            */
    112             inline const std::set<std::string> & getTargetsSet()
     119            inline const std::set<std::string, NotificationListenerStringCompare> & getTargetsSet()
    113120                { return this->targets_; }
    114             bool getTargets(std::string* string) const; //!< Returns a string consisting of the concatination of the targets.
     121
     122            // tolua_begin
     123            bool setTargets(const std::string & targets); //!< Set the targets of this NotificationQueue.
     124            const std::string& getTargets(void) const; //!< Returns a string consisting of the concatination of the targets.
     125            // tolua_end
    115126
    116127        private:
     
    124135            unsigned int displayTime_; //!< The time a Notification is displayed.
    125136
    126             std::set<std::string> targets_; //!< The targets the Queue displays Notifications of.
     137            std::set<std::string, NotificationListenerStringCompare> targets_; //!< The targets the Queue displays Notifications of.
    127138
    128139            std::multiset<NotificationContainer*, NotificationContainerCompare> ordering_; //!< The NotificationContainers ordered by the time they were registered. //TODO: Would set work as well?
     
    139150            bool setName(const std::string& name); //!< Sets the name of the NotificationQueue.
    140151
    141             void setMaxSize(unsigned int size); //!< Sets the maximum number of displayed Notifications.
    142             void setDisplayTime(unsigned int time); //!< Sets the maximum number of seconds a Notification is displayed.
    143 
    144             bool setTargets(const std::string & targets); //!< Set the targets of this NotificationQueue.
    145 
    146152            void sizeChanged(void); //!< Adjusts the NotificationQueue, when the maximum size has changed.
    147153
     
    152158            void clear(void); //!< Clears the queue by removing all Notifications.
    153159
    154     };
     160    }; // tolua_export
    155161
    156 }
     162} // tolua_export
    157163
    158164#endif /* _NotificationOverlay_H__ */
Note: See TracChangeset for help on using the changeset viewer.