本文整理汇总了C++中CUtlDict::RemoveAt方法的典型用法代码示例。如果您正苦于以下问题:C++ CUtlDict::RemoveAt方法的具体用法?C++ CUtlDict::RemoveAt怎么用?C++ CUtlDict::RemoveAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUtlDict
的用法示例。
在下文中一共展示了CUtlDict::RemoveAt方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadMetaClassDefinitionFile
//-----------------------------------------------------------------------------
// Loads up a file containing metaclass definitions
//-----------------------------------------------------------------------------
void CPanelMetaClassMgrImp::LoadMetaClassDefinitionFile( const char *pFileName )
{
MEM_ALLOC_CREDIT();
// Blat out previous metaclass definitions read in from this file...
int i = m_MetaClassKeyValues.Find( pFileName );
if (i != m_MetaClassKeyValues.InvalidIndex() )
{
// Blow away the previous keyvalues from that file
unsigned short j = m_MetaClassDict.First();
while ( j != m_MetaClassDict.InvalidIndex() )
{
unsigned short next = m_MetaClassDict.Next(j);
if ( m_MetaClassDict[j].m_KeyValueIndex == i)
{
m_MetaClassDict.RemoveAt(j);
}
j = next;
}
m_MetaClassKeyValues[i]->deleteThis();
m_MetaClassKeyValues.RemoveAt(i);
}
// Create a new keyvalues entry
KeyValues* pKeyValues = new KeyValues(pFileName);
int idx = m_MetaClassKeyValues.Insert( pFileName, pKeyValues );
// Read in all metaclass definitions...
// Load the file
if ( !pKeyValues->LoadFromFile( filesystem, pFileName ) )
{
Warning( "Couldn't find metaclass definition file %s\n", pFileName );
pKeyValues->deleteThis();
m_MetaClassKeyValues.RemoveAt(idx);
return;
}
else
{
// Go ahead and parse the data now
if ( !ParseMetaClassList( pFileName, pKeyValues, idx ) )
{
Warning( "Detected one or more errors parsing %s\n", pFileName );
}
}
}
示例2: Add
void CClassMap::Add( const char *mapname, const char *classname, int size, DISPATCHFUNCTION factory = 0 )
#endif
{
#if defined ( LUA_SDK )
for ( int i=m_ClassDict.First(); i != m_ClassDict.InvalidIndex(); i=m_ClassDict.Next( i ) )
{
classentry_t *lookup = &m_ClassDict[ i ];
if ( !lookup )
continue;
if ( !Q_stricmp( lookup->GetMapName(), mapname ) )
{
m_ClassDict.RemoveAt( i );
}
}
#else
const char *map = Lookup( classname );
if ( map && !Q_strcasecmp( mapname, map ) )
return;
if ( map )
{
int index = m_ClassDict.Find( classname );
Assert( index != m_ClassDict.InvalidIndex() );
m_ClassDict.RemoveAt( index );
}
#endif
classentry_t element;
element.SetMapName( mapname );
element.factory = factory;
element.size = size;
#if defined ( LUA_SDK )
element.SetClassName( classname );
element.scripted = scripted;
m_ClassDict.Insert( mapname, element );
#else
m_ClassDict.Insert( classname, element );
#endif
}
示例3: RemoveTextureAlias
void CTextureManager::RemoveTextureAlias( const char *pAlias )
{
if ( pAlias == NULL )
return;
char szCleanName[MAX_PATH];
int index = m_TextureAliases.Find( NormalizeTextureName( pAlias, szCleanName, sizeof( szCleanName ) ) );
if ( index == m_TextureAliases.InvalidIndex() )
return; //not found
delete []m_TextureAliases[index];
m_TextureAliases.RemoveAt( index );
}
示例4: RemoveTexture
void CTextureManager::RemoveTexture( ITextureInternal *pTexture )
{
Assert( pTexture->GetReferenceCount() <= 0 );
for ( int i = m_TextureList.First(); i != m_TextureList.InvalidIndex(); i = m_TextureList.Next( i ) )
{
// search by object
if ( m_TextureList[i] == pTexture )
{
ITextureInternal::Destroy( m_TextureList[i] );
m_TextureList.RemoveAt( i );
break;
}
}
}
示例5: RemoveAllScripted
void CClassMap::RemoveAllScripted( void )
{
int c = m_ClassDict.Count();
int i;
for ( i = 0; i < c; i++ )
{
classentry_t *lookup = &m_ClassDict[ i ];
if ( !lookup )
continue;
if ( lookup->scripted )
{
m_ClassDict.RemoveAt( i );
}
}
}
示例6: RemoveUnusedTextures
void CTextureManager::RemoveUnusedTextures( void )
{
int iNext;
for ( int i = m_TextureList.First(); i != m_TextureList.InvalidIndex(); i = iNext )
{
iNext = m_TextureList.Next( i );
#ifdef _DEBUG
if ( m_TextureList[i]->GetReferenceCount() < 0 )
{
Warning( "RemoveUnusedTextures: pTexture->m_referenceCount < 0 for %s\n", m_TextureList[i]->GetName() );
}
#endif
if ( m_TextureList[i]->GetReferenceCount() <= 0 )
{
ITextureInternal::Destroy( m_TextureList[i] );
m_TextureList.RemoveAt( i );
}
}
}
示例7:
NetworkedClass::~NetworkedClass()
{
unsigned short lookup;
// Remove pointer
lookup = m_NetworkClassDatabase.Find( m_pNetworkName );
if ( lookup != m_NetworkClassDatabase.InvalidIndex() )
{
// Only remove if it's our pointer. Otherwise we are already replaced.
if( m_NetworkClassDatabase.Element( lookup ) == this )
m_NetworkClassDatabase.RemoveAt( lookup );
}
else
{
Warning("NetworkedClass destruction: invalid networkclass %s\n", m_pNetworkName);
}
if( m_pClientClass )
{
m_pClientClass->m_bFree = true;
}
free( (void *)m_pNetworkName );
m_pNetworkName = NULL;
}