本文整理汇总了C++中CElement::SetElementGroup方法的典型用法代码示例。如果您正苦于以下问题:C++ CElement::SetElementGroup方法的具体用法?C++ CElement::SetElementGroup怎么用?C++ CElement::SetElementGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CElement
的用法示例。
在下文中一共展示了CElement::SetElementGroup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
CElementGroup::~CElementGroup()
{
// Delete all the elements
if (!m_elements.empty())
{
if (!g_pGame->IsBeingDeleted())
{
CEntityRemovePacket removePacket;
for (CFastList<CElement*>::iterator iter = m_elements.begin(); iter != m_elements.end(); iter++)
{
CElement* pElement = (*iter);
switch (pElement->GetType())
{
case CElement::DATABASE_CONNECTION:
case CElement::SCRIPTFILE:
continue;
default:
break;
}
// Tell everyone to destroy it if this is not a per-player entity
if (pElement->IsPerPlayerEntity())
{
// Unsync it (will destroy it for those that know about it)
CPerPlayerEntity* pEntity = static_cast<CPerPlayerEntity*>(pElement);
pEntity->Sync(false);
}
else
{
// Tell everyone to destroy it
removePacket.Add(pElement);
}
}
g_pGame->GetPlayerManager()->BroadcastOnlyJoined(removePacket);
}
CElementDeleter* deleter = g_pGame->GetElementDeleter();
CElement* pElement = NULL;
for (CFastList<CElement*>::iterator iter = m_elements.begin(); iter != m_elements.end(); iter++)
{
pElement = *iter;
pElement->SetElementGroup(NULL);
pElement->DeleteAllEvents();
deleter->Delete(pElement, true, false);
}
// Do this at the end for speed
g_pGame->GetMapManager()->GetRootElement()->UpdatePerPlayerEntities();
}
}