void BubbleManager::Remove(SystemEntity *ent, bool notify) { SystemBubble *b = ent->Bubble(); if(b == NULL) { //not in any bubble. _log(DESTINY__BUBBLE_TRACE, "Entity %u is not located in any bubble. Nothing to remove.", ent->GetID()); return; } b->Remove(ent, notify); }
void BubbleManager::UpdateBubble(SystemEntity *ent, bool notify) { SystemBubble *b = ent->Bubble(); if(b != NULL) { if(b->InBubble(ent->GetPosition())) { _log(DESTINY__BUBBLE_TRACE, "Entity %u is still located in bubble %p", ent->GetID(), b); //still in bubble... return; } _log(DESTINY__BUBBLE_TRACE, "Entity %u is no longer located in bubble %p", ent->GetID(), b); b->Remove(ent, notify); } Add(ent, notify); }
void BubbleManager::UpdateBubble(SystemEntity *ent, bool notify, bool isWarping, bool isPostWarp) { SystemBubble *b = ent->Bubble(); if(b != NULL) { if(b->InBubble(ent->GetPosition())) { _log(DESTINY__BUBBLE_DEBUG, "Entity %u at (%.2f,%.2f,%.2f) is still located in bubble %u at (%.2f,%.2f,%.2f) with radius %.2f", ent->GetID(), ent->GetPosition().x, ent->GetPosition().y, ent->GetPosition().z, b->GetBubbleID(), b->m_center.x, b->m_center.y, b->m_center.z, b->m_radius); //_log(DESTINY__BUBBLE_TRACE, "Entity %u is still located in bubble %u", ent->GetID(), b->GetBubbleID()); //still in bubble... sLog.Debug( "BubbleManager::UpdateBubble()", "SystemEntity '%s' is still located in Bubble %u", ent->GetName(), b->GetBubbleID() ); return; } _log(DESTINY__BUBBLE_DEBUG, "Entity %u at (%.2f,%.2f,%.2f) is no longer located in bubble %u at (%.2f,%.2f,%.2f) with radius %.2f", ent->GetID(), ent->GetPosition().x, ent->GetPosition().y, ent->GetPosition().z, b->GetBubbleID(), b->m_center.x, b->m_center.y, b->m_center.z, b->m_radius); //_log(DESTINY__BUBBLE_TRACE, "Entity %u is no longer located in bubble %u", ent->GetID(), b->GetBubbleID()); b->Remove(ent, notify); sLog.Debug( "BubbleManager::UpdateBubble()", "SystemEntity '%s' being removed from Bubble %u", ent->GetName(), b->GetBubbleID() ); } else sLog.Debug( "BubbleManager::UpdateBubble()", "SystemEntity '%s' not currently in ANY Bubble!!!", ent->GetName() ); if( !isWarping ) Add(ent, notify, isPostWarp); }
void BubbleManager::Remove(SystemEntity *ent, bool notify) { SystemBubble *b = ent->Bubble(); if(b == NULL) { //not in any bubble. _log(DESTINY__BUBBLE_TRACE, "Entity %u is not located in any bubble. Nothing to remove.", ent->GetID()); return; } b->Remove(ent, notify); sLog.Debug( "BubbleManager::Remove()", "SystemEntity '%s' being removed from Bubble %u", ent->GetName(), b->GetBubbleID() ); std::vector<SystemBubble *>::iterator cur, end; cur = m_bubbles.begin(); end = m_bubbles.end(); for(; cur != end; ++cur) { SystemBubble *b = *cur; if(b->IsEmpty()) { sLog.Debug( "BubbleManager::Remove()", "Bubble %u is empty and is therefore being deleted from the system right now.", b->GetBubbleID() ); m_bubbles.erase(cur); cur = m_bubbles.begin(); end = m_bubbles.end(); } } }