Exemplo n.º 1
0
	//------------------------------------------------------------------------------
	real CGUIAsWidgetMoveTo::Update( real fDeltaTime )
	{
		if( !IsRetired() )
		{
			const CGUIVector2& rCurPos = GetReceiver()->GetPosition();
			if( rCurPos == m_aDestination )
			{
				Retire( true );
				return 0.0f;
			}
			CGUIVector2 aDelta = m_aDestination - rCurPos;
			real fDeltaLen = aDelta.Normalise();
			real fCurMoveLen = m_fVelocity * fDeltaTime;
			if( fDeltaLen <= fCurMoveLen )
			{
				GetReceiver()->SetPosition( m_aDestination );
				Retire( true );
				return 0.0f;
			}
			else
			{
				GetReceiver()->SetPosition( rCurPos + aDelta * fCurMoveLen );
			}
		}

		return 0.0f;
	}
Exemplo n.º 2
0
void C4PlayerList::Execute()
{
	C4Player *pPlr;
	// Execute
	for (pPlr=First; pPlr; pPlr=pPlr->Next)
		pPlr->Execute();
	// Check retirement
	for (pPlr=First; pPlr; pPlr=pPlr->Next)
		if (pPlr->Eliminated && !pPlr->RetireDelay)
			{ Retire(pPlr); break; }
}
Exemplo n.º 3
0
void C4ObjectInfo::Evaluate()
{
	Retire();
	if (WasInAction) Rounds++;
}