import class MinigameLogicController extends inkLogicController
{
	protected import var gameName : CName;
	protected var m_isGameRunning : Bool;

	public import function FinishGame();

	protected virtual function OnInitializeGameLogic() {}

	protected virtual function OnGameStateUpdateLogic( gameStateUpdateEvent : MiniGameStateUpdateEvent ) {}

	protected virtual function FinishGameLogic()
	{
		m_isGameRunning = false;
		FinishGame();
	}

	protected event OnInitializeGame()
	{
		m_isGameRunning = true;
		OnInitializeGameLogic();
	}

	protected event OnGameStateUpdate( gameStateUpdateEvent : MiniGameStateUpdateEvent )
	{
		if( gameStateUpdateEvent.gameName == gameName && m_isGameRunning )
		{
			OnGameStateUpdateLogic( gameStateUpdateEvent );
		}
	}

}

