class QuadRacerObstacleCollisionLogic extends MinigameCollisionLogic
{

	protected event OnHitPlayer( hitEvent : HitPlayerEvent )
	{
		var gameState : QuadRacerGameState;
		if( hitEvent )
		{
			gameState = ( ( QuadRacerGameState )( hitEvent.gameState ) );
			gameState.shouldPushBackPlayer = true;
			UpdateGameState( gameState );
		}
	}

}

class QuadRacerBonusCollisionLogic extends MinigameCollisionLogic
{
	private var hasTriggered : Bool;

	protected event OnInitialize()
	{
		hasTriggered = false;
	}

	protected event OnHitPlayer( hitEvent : HitPlayerEvent )
	{
		var gameState : QuadRacerGameState;
		if( hitEvent )
		{
			gameState = ( ( QuadRacerGameState )( hitEvent.gameState ) );
			if( !( hasTriggered ) )
			{
				ChangeGameState( gameState );
				hasTriggered = true;
				GetRootWidget().SetVisible( false );
			}
			UpdateGameState( gameState );
		}
	}

	protected event OnRecycle()
	{
		hasTriggered = false;
	}

	protected virtual function ChangeGameState( gameState : QuadRacerGameState ) {}
}

class NitroCollisionLogic extends QuadRacerBonusCollisionLogic
{

	protected override function ChangeGameState( gameState : QuadRacerGameState )
	{
		gameState.boostTime += 5.0;
	}

}

class OneTimeCollisionLogic extends QuadRacerBonusCollisionLogic
{

	protected override function ChangeGameState( gameState : QuadRacerGameState )
	{
		gameState.shouldPushBackPlayer = true;
	}

}

