class BonusCollisionLogic extends MinigameCollisionLogic
{
	protected var hasTriggered : Bool;

	protected event OnInitialize()
	{
		Reset();
	}

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

	protected virtual function ChangeGameState( gameState : RoachRaceGameState ) {}

	protected event OnRecycle()
	{
		Reset();
	}

	private function Reset()
	{
		hasTriggered = false;
		GetRootWidget().SetVisible( true );
	}

}

class HealthCollisionLogic extends BonusCollisionLogic
{

	protected override function ChangeGameState( gameState : RoachRaceGameState )
	{
		gameState.currentLives += 1;
	}

}

class DoublePointsCollisionLogic extends BonusCollisionLogic
{

	protected override function ChangeGameState( gameState : RoachRaceGameState )
	{
		gameState.pointsBonusTime += 10.0;
	}

}

class InvincibilityCollisionLogic extends BonusCollisionLogic
{

	protected override function ChangeGameState( gameState : RoachRaceGameState )
	{
		gameState.invincibleTime += 5.0;
	}

}

