Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 24, 2010, 4:01:04 PM (15 years ago)
Author:
dafrick
Message:

Mostly more documentation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/notifications/NotificationQueue.cc

    r7488 r7489  
    9090        this->create(); // Creates the NotificationQueue in lua.
    9191
    92         // register the NotificationQueue as NotificationListener with the NotificationManager.
     92        // Register the NotificationQueue as NotificationListener with the NotificationManager.
    9393        bool listenerRegistered = NotificationManager::getInstance().registerListener(this);
    9494        if(!listenerRegistered) // If the registration has failed.
     
    9696            this->registered_ = false;
    9797            // Remove the NotificationQueue in lua.
    98             GUIManager::getInstance().getLuaState()->doString("NotificationLayer.removeQueue(\"" + this->getName() +  "\")");
     98            if(GameMode::showsGraphics())
     99                GUIManager::getInstance().getLuaState()->doString("NotificationLayer.removeQueue(\"" + this->getName() +  "\")");
    99100            NotificationManager::getInstance().unregisterQueue(this);
    100101            COUT(1) << "Error: NotificationQueue '" << this->getName() << "' could not be registered." << std::endl;
     
    210211    void NotificationQueue::update(Notification* notification, const std::time_t & time)
    211212    {
     213        assert(notification);
     214
    212215        this->push(notification, time);
    213216
     
    226229    void NotificationQueue::push(Notification* notification, const std::time_t & time)
    227230    {
     231        assert(notification);
     232
    228233        NotificationContainer* container = new NotificationContainer;
    229234        container->notification = notification;
     
    254259        // Get all the NotificationContainers that were sent the same time the NotificationContainer we want to pop was sent.
    255260        std::pair<std::multiset<NotificationContainer*, NotificationContainerCompare>::iterator, std::multiset<NotificationContainer*, NotificationContainerCompare>::iterator> iterators = this->ordering_.equal_range(container);
    256         // Iterate thourgh all suspects and remove the container as soon as we find it.
     261        // Iterate through all suspects and remove the container as soon as we find it.
    257262        for(std::multiset<NotificationContainer*, NotificationContainerCompare>::iterator it = iterators.first; it != iterators.second; it++)
    258263        {
     
    311316
    312317        this->notifications_.clear();
    313 
    314318        this->size_ = 0;
    315319
Note: See TracChangeset for help on using the changeset viewer.