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


C++ CHandle::FinishAct方法代码示例

本文整理汇总了C++中CHandle::FinishAct方法的典型用法代码示例。如果您正苦于以下问题:C++ CHandle::FinishAct方法的具体用法?C++ CHandle::FinishAct怎么用?C++ CHandle::FinishAct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CHandle的用法示例。


在下文中一共展示了CHandle::FinishAct方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: StartAct

//-----------------------------------------------------------------------------
// Purpose: The act has started
//-----------------------------------------------------------------------------
void CInfoAct::StartAct( void )
{
	// FIXME: Should this change?
	// Don't allow two simultaneous acts
	if (g_hCurrentAct)
	{
		g_hCurrentAct->FinishAct( );
	}

	// Set the global act to this
	g_hCurrentAct = this;

	m_flActStartedAt = gpGlobals->curtime;
	m_OnStarted.FireOutput( this, this );

	// Do we have a timelimit?
	if ( m_flActTimeLimit )
	{
		SetNextThink( gpGlobals->curtime + m_flActTimeLimit );
		SetThink( ActThink );
	}

	SetUpRespawnTimers();

	// Tell all the clients
	CRelieableBroadcastRecipientFilter filter;

	UserMessageBegin( filter, "ActBegin" );
		WRITE_BYTE( (byte)m_iActNumber );
		WRITE_FLOAT( m_flActStartedAt );
	MessageEnd();

	// If we're not an intermission, clean up
	if ( !HasSpawnFlags( SF_ACT_INTERMISSION ) )
	{
		CleanupOnActStart();
	}

	// Cycle through all players and start the act
	for ( int i = 1; i <= gpGlobals->maxClients; i++ )
	{
		CBaseTFPlayer *pPlayer = (CBaseTFPlayer*)UTIL_PlayerByIndex( i );
		if ( pPlayer  )
		{
			// Am I an intermission?
			if ( HasSpawnFlags( SF_ACT_INTERMISSION ) )
			{
				StartIntermission( pPlayer );
			}
			else
			{
				StartActOverlayTime( pPlayer );
			}
		}
	}

	// Think again soon, to remove player locks
	if ( !HasSpawnFlags(SF_ACT_INTERMISSION) )
	{
		SetNextThink( gpGlobals->curtime + MIN_ACT_OVERLAY_TIME );
		SetThink( ActThinkEndActOverlayTime );
	}
}
开发者ID:RaisingTheDerp,项目名称:raisingthebar,代码行数:66,代码来源:info_act.cpp


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