class HitEventEffector extends Effector
{

	protected function GetHitEvent() : gameHitEvent
	{
		var multiPrereqState : MultiPrereqState;
		var hitPrereqState : GenericHitPrereqState;
		hitPrereqState = ( ( GenericHitPrereqState )( GetPrereqState() ) );
		if( hitPrereqState )
		{
			return hitPrereqState.GetHitEvent();
		}
		multiPrereqState = ( ( MultiPrereqState )( GetPrereqState() ) );
		if( multiPrereqState )
		{
			return FindHitEventInMultiPrereq( multiPrereqState );
		}
		return NULL;
	}

	private function FindHitEventInMultiPrereq( multiPrereqState : MultiPrereqState ) : gameHitEvent
	{
		var i : Int32;
		var nextMultiPrereqState : MultiPrereqState;
		var hitPrereqState : GenericHitPrereqState;
		var result : gameHitEvent;
		for( i = 0; i < multiPrereqState.nestedStates.Size(); i += 1 )
		{
			hitPrereqState = ( ( GenericHitPrereqState )( multiPrereqState.nestedStates[ i ] ) );
			if( hitPrereqState )
			{
				return hitPrereqState.GetHitEvent();
			}
			else
			{
				nextMultiPrereqState = ( ( MultiPrereqState )( multiPrereqState.nestedStates[ i ] ) );
				if( nextMultiPrereqState )
				{
					result = FindHitEventInMultiPrereq( nextMultiPrereqState );
					if( result )
					{
						return result;
					}
				}
			}
		}
		return result;
	}

}

