本文整理汇总了C++中CElementGroup::Remove方法的典型用法代码示例。如果您正苦于以下问题:C++ CElementGroup::Remove方法的具体用法?C++ CElementGroup::Remove怎么用?C++ CElementGroup::Remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CElementGroup
的用法示例。
在下文中一共展示了CElementGroup::Remove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadMapData
CElement* CMapManager::LoadMapData ( CResource& Loader, CElement& Parent, CXMLNode& Node )
{
// Load the elements
vector < CElement* > ElementsAdded;
CElement* pLoadedRoot = LoadNode ( Loader, Node, &Parent, &ElementsAdded, false );
if ( pLoadedRoot )
{
// Add all the elements that are entities to a sync packet
CEntityAddPacket AddPacket;
vector < CElement* > ::const_iterator iter = ElementsAdded.begin ();
for ( ; iter != ElementsAdded.end (); iter++ )
{
// Is it a per-player entity? Sync it. Otherwize add it to the packet.
if ( IS_PERPLAYER_ENTITY ( *iter ) )
{
static_cast < CPerPlayerEntity* > ( *iter )->Sync ( true );
}
else
{
AddPacket.Add ( *iter );
}
}
// Send it to everyone
m_pPlayerManager->BroadcastOnlyJoined ( AddPacket );
return pLoadedRoot;
}
// If unsuccessfull, destroy the new elements. Remember removing it from our element group.
CElementGroup* pElementGroup = Loader.GetElementGroup ();
vector < CElement* > ::const_iterator iter = ElementsAdded.begin ();
for ( ; iter != ElementsAdded.end (); iter++ )
{
pElementGroup->Remove ( *iter );
delete *iter;
}
// Failed
return NULL;
}