当前位置: 首页>>代码示例>>C++>>正文


C++ CUtlVector::HasElement方法代码示例

本文整理汇总了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 );
	}
}
开发者ID:hitmen047,项目名称:g-string_2013,代码行数:8,代码来源:point_holo_objective.cpp

示例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 );
	}
}
开发者ID:BSVino,项目名称:source-shader-editor,代码行数:28,代码来源:vbasecontainer.cpp

示例3: RemoveHoloObjective

void RemoveHoloObjective( CPointHoloObjective *pEntity )
{
	if ( g_HoloObjectives.HasElement( pEntity ) )
	{
		g_HoloObjectives.FindAndRemove( pEntity );
	}
}
开发者ID:hitmen047,项目名称:g-string_2013,代码行数:7,代码来源:point_holo_objective.cpp

示例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;
		}
	}
}
开发者ID:TrentSterling,项目名称:D0G,代码行数:61,代码来源:AnimationController.cpp

示例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 );
		}
	}
}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:45,代码来源:soundscape.cpp

示例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
}
开发者ID:DonnaLisa,项目名称:swarm-deferred,代码行数:10,代码来源:CDefLightContainer.cpp


注:本文中的CUtlVector::HasElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。