void ViewSegment::eventAdded(const Segment *t, Event *e) { Profiler profiler("ViewSegment::eventAdded"); Q_ASSERT(t == &m_segment); (void)t; // avoid warnings if (wrapEvent(e)) { ViewElement *el = makeViewElement(e); m_viewElementList->insert(el); notifyAdd(el); } }
void LocalMap::registerColony( Colony* colony ) { U::log( U::c( "Map ", this, ": ", "Registering colony ", colony, " with lid=", colony->getID( ) ) ); AssocArray<LocationID, Colony*>::iterator i = colonies.find( colony->getID( ) ); if( i == colonies.end( ) ) { U::log( U::c( " - Inserting colony lid=", colony->getID( ) , " as new colony." ) ); // No existing entry; insert colonies.insert( U::p( colony->getID( ), colony ) ); // Inform listeners notifyAdd( colony, typeid( colony ) ); } else { U::log( U::c( " - Merging colony lid=", colony->getID( ) , " with pre-existing colony ", i->second, "." ) ); // Existing entry; must merge. i->second = i->second->merge( colony ); } }
void LocalMap::registerPlanet( AdminPlanet* planet ) { U::log( U::c( "Map ", this, ": ", "Registering planet ", planet, " with pid(lid)=", planet->getID( ) ) ); AssocArray<LocationID, AdminPlanet*>::iterator i = planets.find( planet->getID( ) ); if( i == planets.end( ) ) { U::log( U::c( " - Inserting planet ", planet, " as new planet." ) ); // No existing entry; insert planets.insert( U::p( planet->getID( ), planet ) ); // Inform listeners notifyAdd( planet, typeid( planet ) ); } else { U::log( U::c( " - Merging planet ", planet, " with pre-existing planet ", i->second, "." ) ); // Existing entry; must merge. i->second = i->second->merge( planet ); } }