本文整理汇总了C++中CUtlVector::Remove方法的典型用法代码示例。如果您正苦于以下问题:C++ CUtlVector::Remove方法的具体用法?C++ CUtlVector::Remove怎么用?C++ CUtlVector::Remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUtlVector
的用法示例。
在下文中一共展示了CUtlVector::Remove方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Shutdown
void C_SoundscapeSystem::Shutdown()
{
for ( int i = m_loopingSounds.Count() - 1; i >= 0; --i )
{
loopingsound_t &sound = m_loopingSounds[i];
// sound is done, remove from list.
StopLoopingSound( sound );
}
// These are only necessary so we can use shutdown/init calls
// to flush soundscape data
m_loopingSounds.RemoveAll();
m_randomSounds.RemoveAll();
m_soundscapes.RemoveAll();
m_params.ent.Set( NULL );
m_params.soundscapeIndex = -1;
while ( m_SoundscapeScripts.Count() > 0 )
{
KeyValues *kv = m_SoundscapeScripts[ 0 ];
m_SoundscapeScripts.Remove( 0 );
kv->deleteThis();
}
}
示例2: ConstraintThink
//-----------------------------------------------------------------------------
// Purpose: Check to see if any of our constrained players have broken the constraint
//-----------------------------------------------------------------------------
void CPointPlayerMoveConstraint::ConstraintThink( void )
{
int iCount = m_hConstrainedPlayers.Count();
// Count backwards, because we might drop them if they've broken the constraint
for ( int i = (iCount-1); i >= 0; i-- )
{
CBasePlayer *pPlayer = ToBasePlayer( m_hConstrainedPlayers[i] );
if ( pPlayer )
{
float flDistanceSqr = (pPlayer->GetAbsOrigin() - GetAbsOrigin()).LengthSqr();
if ( flDistanceSqr > m_flRadiusSquared )
{
// Break the constraint to this player
pPlayer->DeactivateMovementConstraint();
m_hConstrainedPlayers.Remove(i);
// Fire the broken output
m_OnConstraintBroken.FireOutput( this, pPlayer );
}
}
}
// Only keep thinking if we any left
if ( m_hConstrainedPlayers.Count() )
{
SetNextThink( gpGlobals->curtime + 0.1f );
}
}
示例3: PostSimulate
void CParticleSystemQuery::PostSimulate( )
{
#if defined( CLIENT_DLL )
TProjectedTextureInfo *pInfo;
while( m_ProjectedInfoAdds.PopItem( &pInfo ) == true )
{
m_ActiveProjectedInfos.AddToTail( pInfo );
}
for( int i = 0; i < m_ActiveProjectedInfos.Count(); i++ )
{
if ( m_ActiveProjectedInfos[ i ]->m_bUsedThisFrame == false )
{
delete m_ActiveProjectedInfos[ i ]->m_pEntity;
m_ActiveProjectedInfos.Remove( i );
i--;
continue;
}
if ( m_ActiveProjectedInfos[ i ]->m_pEntity == NULL )
{
m_ActiveProjectedInfos[ i ]->m_pEntity = C_EnvProjectedTexture::Create();
}
m_ActiveProjectedInfos[ i ]->m_pEntity->SetAbsOrigin( m_ActiveProjectedInfos[ i ]->m_vOrigin );
m_ActiveProjectedInfos[ i ]->m_pEntity->SetMaterial( m_ActiveProjectedInfos[ i ]->m_pMaterial );
m_ActiveProjectedInfos[ i ]->m_pEntity->SetLightColor( m_ActiveProjectedInfos[ i ]->m_r * 255, m_ActiveProjectedInfos[ i ]->m_g * 255, m_ActiveProjectedInfos[ i ]->m_b * 255, m_ActiveProjectedInfos[ i ]->m_a * 255 );
m_ActiveProjectedInfos[ i ]->m_pEntity->SetSize( m_ActiveProjectedInfos[ i ]->m_flSize );
m_ActiveProjectedInfos[ i ]->m_pEntity->SetRotation( m_ActiveProjectedInfos[ i ]->m_flRotation );
}
#endif // #if defined( CLIENT_DLL )
}
示例4: CreateExecutionMarker
static int CreateExecutionMarker()
{
if ( g_ExecutionMarkers.Count() > 2048 )
g_ExecutionMarkers.Remove( 0 );
int i = g_ExecutionMarkers.AddToTail( RandomInt( 0, 1<<30 ) );
return g_ExecutionMarkers[i];
}
示例5: FindAndRemoveExecutionMarker
static bool FindAndRemoveExecutionMarker( int iCode )
{
int i = g_ExecutionMarkers.Find( iCode );
if ( i == g_ExecutionMarkers.InvalidIndex() )
return false;
g_ExecutionMarkers.Remove( i );
return true;
}
示例6: DissolveThink
//-----------------------------------------------------------------------------
// Purpose: Dissolve all weapons within our volume
//-----------------------------------------------------------------------------
void CTriggerWeaponDissolve::DissolveThink( void )
{
int numWeapons = m_pWeapons.Count();
// Dissolve all the items within the volume
for ( int i = 0; i < numWeapons; i++ )
{
CBaseCombatWeapon *pWeapon = m_pWeapons[i];
Vector vecConduit = GetConduitPoint( pWeapon );
// The physcannon upgrades when this happens
if ( FClassnameIs( pWeapon, "weapon_physcannon" ) )
{
// This must be the last weapon for us to care
if ( numWeapons > 1 )
continue;
//FIXME: Make them do this on a stagger!
// All conduits send power to the weapon
for ( int i = 0; i < m_pConduitPoints.Count(); i++ )
{
CreateBeam( m_pConduitPoints[i]->GetAbsOrigin(), pWeapon, 4.0f );
}
PhysCannonBeginUpgrade( pWeapon );
m_OnChargingPhyscannon.FireOutput( this, this );
EmitSound( "WeaponDissolve.Beam" );
// We're done
m_pWeapons.Purge();
m_pConduitPoints.Purge();
SetContextThink( NULL, 0, s_pDissolveThinkContext );
return;
}
// Randomly dissolve them all
float flLifetime = random->RandomFloat( 2.5f, 4.0f );
CreateBeam( vecConduit, pWeapon, flLifetime );
pWeapon->Dissolve( NULL, gpGlobals->curtime + ( 3.0f - flLifetime ), false );
m_OnDissolveWeapon.FireOutput( this, this );
CPASAttenuationFilter filter( pWeapon );
EmitSound( filter, pWeapon->entindex(), "WeaponDissolve.Dissolve" );
// Beam looping sound
EmitSound( "WeaponDissolve.Beam" );
m_pWeapons.Remove( i );
SetContextThink( &CTriggerWeaponDissolve::DissolveThink, gpGlobals->curtime + random->RandomFloat( 0.5f, 1.5f ), s_pDissolveThinkContext );
return;
}
SetContextThink( &CTriggerWeaponDissolve::DissolveThink, gpGlobals->curtime + 0.1f, s_pDissolveThinkContext );
}
示例7: RemoveLightSource
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CDarknessLightSourcesSystem::RemoveLightSource( CInfoDarknessLightSource *pEntity )
{
for ( int i = m_LightSources.Count() - 1; i >= 0; i-- )
{
if ( m_LightSources[i].hEntity == pEntity )
{
m_LightSources.Remove(i);
}
}
}
示例8: Templates_RemoveByHammerID
void Templates_RemoveByHammerID( int nHammerID )
{
for ( int i=g_Templates.Count()-1; i >= 0; i-- )
{
if ( g_Templates[i]->m_nHammerID == nHammerID )
{
Templates_FreeTemplate( g_Templates[i] );
g_Templates.Remove( i );
}
}
}
示例9: UpdateOnRemove
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void CNPC_EnemyFinderCombineCannon::UpdateOnRemove()
{
BaseClass::UpdateOnRemove();
// See if I'm in the list of Combine enemyfinders
int index = s_ListEnemyfinders.Find(this);
if( index != -1 )
{
s_ListEnemyfinders.Remove(index);
}
}
示例10: RemoveCore
void CPhysicsMotionController::RemoveCore( IVP_Core *pCore )
{
int index = m_coreList.Find(pCore);
if ( !m_coreList.IsValidIndex(index) )
{
#if DEBUG
Msg("removed invalid core !!!\n");
#endif
return;
}
m_coreList.Remove( index );
pCore->rem_core_controller( static_cast<IVP_Controller_Independent *>(this) );
}
示例11: UpdateServicesBrowserIPs
void UpdateServicesBrowserIPs()
{
double curTime = Plat_FloatTime();
for ( int i=0; i < g_ServicesBrowsers.Count(); i++ )
{
if ( (curTime - g_ServicesBrowsers[i].m_flLastPingTime) >= SERVICES_BROWSER_TIMEOUT )
{
g_ServicesBrowsers.Remove( i );
--i;
break;
}
}
}
示例12: EndTouch
//-----------------------------------------------------------------------------
// Purpose: Called when an entity stops touching us.
// Input : pOther - The entity that was touching us.
//-----------------------------------------------------------------------------
void CTriggerWateryDeath::EndTouch( CBaseEntity *pOther )
{
if ( IsTouching( pOther ) )
{
EHANDLE hOther;
hOther = pOther;
// Remove the time from our list
int iIndex = m_hTouchingEntities.Find( hOther );
if ( iIndex != m_hTouchingEntities.InvalidIndex() )
{
m_flEntityKillTimes.Remove( iIndex );
}
}
#ifdef HL2_DLL
if ( pOther->IsPlayer() )
{
for (int i = 0; i < m_hLeeches.Count(); i++ )
{
CWateryDeathLeech *pLeech = dynamic_cast<CWateryDeathLeech*>( m_hLeeches[i].Get() );
if ( pLeech )
{
pLeech->m_iFadeState = -1;
}
}
if ( m_hLeeches.Count() > 0 )
m_hLeeches.Purge();
CHL2_Player *pHL2Player = dynamic_cast<CHL2_Player*>( pOther );
if ( pHL2Player )
{
//Adrian: Hi, you might be wondering why I'm doing this, yes?
// Well, EndTouch is called not only when the player leaves
// the trigger, but also on level shutdown. We can't let the
// soundpatch fade the sound out since we'll hit a nasty assert
// cause it'll try to fade out a sound using an entity that might
// be gone since we're shutting down the server.
if ( !(pHL2Player->GetFlags() & FL_DONTTOUCH ) )
pHL2Player->StopWaterDeathSounds();
}
}
#endif
BaseClass::EndTouch( pOther );
}
示例13: RemoveExcessElements
//-----------------------------------------------------------------------------
// Purpose: The blob has too many elements. Locate good candidates and remove
// this many elements.
//-----------------------------------------------------------------------------
void CNPC_Blob::RemoveExcessElements( int iNumElements )
{
// For now we're not assessing candidates, just blindly removing.
int i;
for( i = 0 ; i < iNumElements ; i++ )
{
int iLastElement = m_iNumElements - 1;
// Nuke the associated entity
m_Elements[ iLastElement ]->SUB_Remove();
m_Elements.Remove( iLastElement );
m_iNumElements--;
}
}
示例14: DrawMessageEntities
// This is a hack to make point_message stuff appear in developer 0 release builds
// for now
void DrawMessageEntities()
{
int c = g_MessageEntities.Count();
for ( int i = c - 1; i >= 0; i-- )
{
CMessageEntity *me = g_MessageEntities[ i ];
if ( !me )
{
g_MessageEntities.Remove( i );
continue;
}
me->DrawOverlays();
}
}
示例15: RemoveTickSignal
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CVGui::RemoveTickSignal( VPANEL panel )
{
// remove from tick signal dar
int count = m_TickSignalVec.Count();
for (int i = 0; i < count; i++ )
{
Tick_t *tick = m_TickSignalVec[i];
if ( tick->panel == panel )
{
m_TickSignalVec.Remove( i );
delete tick;
return;
}
}
}