//------------------------------------------------------------------------------ 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; }
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; } }
void C4ObjectInfo::Evaluate() { Retire(); if (WasInAction) Rounds++; }