本文整理汇总了C++中CUtlVector::HasElement方法的典型用法代码示例。如果您正苦于以下问题:C++ CUtlVector::HasElement方法的具体用法?C++ CUtlVector::HasElement怎么用?C++ CUtlVector::HasElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUtlVector
的用法示例。
在下文中一共展示了CUtlVector::HasElement方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddHoloObjective
void AddHoloObjective( CPointHoloObjective *pEntity )
{
Assert( !g_HoloObjectives.HasElement( pEntity ) );
if ( !g_HoloObjectives.HasElement( pEntity ) )
{
g_HoloObjectives.AddToTail( pEntity );
}
}
示例2: SelectAllInBounds
void CBaseContainerNode::SelectAllInBounds( bool bSelected, CUtlVector<CBaseNode*> *hNodes )
{
CUtlVector<CBaseNode*> local;
CUtlVector<CBaseNode*> *nodes = hNodes ? hNodes : &local;
Assert( nodes );
int numNodes = pNodeView->GetNumNodes();
for ( int i = 0; i < numNodes; i++ )
{
CBaseNode *n = pNodeView->GetNode( i );
if ( n == this )
continue;
Vector2D nodePos = n->GetContainerSensitiveCenter();
bool bIsActive = IsInContainerBounds( nodePos );
if ( !bIsActive )
continue;
if ( nodes->HasElement( n ) )
continue;
nodes->AddToTail( n );
n->SetSelected( bSelected );
if ( n->GetAsContainer() != NULL )
n->GetAsContainer()->SelectAllInBounds( bSelected, nodes );
}
}
示例3: RemoveHoloObjective
void RemoveHoloObjective( CPointHoloObjective *pEntity )
{
if ( g_HoloObjectives.HasElement( pEntity ) )
{
g_HoloObjectives.FindAndRemove( pEntity );
}
}
示例4: UpdatePostedMessages
//-----------------------------------------------------------------------------
// Purpose: checks all posted animation events, firing if time
//-----------------------------------------------------------------------------
void AnimationController::UpdatePostedMessages(bool bRunToCompletion)
{
CUtlVector<RanEvent_t> eventsRanThisFrame;
// check all posted messages
for (int i = 0; i < m_PostedMessages.Count(); i++)
{
PostedMessage_t &msgRef = m_PostedMessages[i];
if (m_flCurrentTime < msgRef.startTime && !bRunToCompletion)
continue;
// take a copy of th message
PostedMessage_t msg = msgRef;
// remove the event
// do this before handling the message because the message queue may be messed with
m_PostedMessages.Remove(i);
// reset the count, start the whole queue again
i = -1;
// handle the event
switch (msg.commandType)
{
case CMD_RUNEVENT:
{
RanEvent_t curEvent;
curEvent.event = msg.event;
curEvent.pParent = msg.parent.Get();
// run the event, but only if we haven't already run it this frame, for this parent
if (!eventsRanThisFrame.HasElement(curEvent))
{
eventsRanThisFrame.AddToTail(curEvent);
RunCmd_RunEvent(msg);
}
}
break;
case CMD_STOPEVENT:
RunCmd_StopEvent(msg);
break;
case CMD_STOPPANELANIMATIONS:
RunCmd_StopPanelAnimations(msg);
break;
case CMD_STOPANIMATION:
RunCmd_StopAnimation(msg);
break;
case CMD_SETFONT:
RunCmd_SetFont(msg);
break;
case CMD_SETTEXTURE:
RunCmd_SetTexture(msg);
break;
case CMD_SETSTRING:
RunCmd_SetString( msg );
break;
}
}
}
示例5: PlayerUpdateThink
// look for dead/spectating players in our volume, to call touch on
void CTriggerSoundscape::PlayerUpdateThink()
{
int i;
SetNextThink( gpGlobals->curtime + 0.2 );
CUtlVector<CBasePlayerHandle> oldSpectators;
oldSpectators = m_spectators;
m_spectators.RemoveAll();
for ( i=1; i <= gpGlobals->maxClients; ++i )
{
CBasePlayer *player = UTIL_PlayerByIndex( i );
if ( !player )
continue;
if ( player->IsAlive() )
continue;
// if the spectator is intersecting the trigger, track it, and start a touch if it is just starting to touch
if ( Intersects( player ) )
{
if ( !oldSpectators.HasElement( player ) )
{
StartTouch( player );
}
m_spectators.AddToTail( player );
}
}
// check for spectators who are no longer intersecting
for ( i=0; i<oldSpectators.Count(); ++i )
{
CBasePlayer *player = oldSpectators[i];
if ( !player )
continue;
if ( !m_spectators.HasElement( player ) )
{
EndTouch( player );
}
}
}
示例6:
CDeferredLightContainer::~CDeferredLightContainer()
{
Assert( __g_pLightContainerDict.HasElement( this ) );
__g_pLightContainerDict.FindAndRemove( this );
#ifdef CLIENT_DLL
Assert( m_iSanityCounter == 0 );
Assert( m_hLights.Count() == 0 );
#endif
}