import enum gameuiAuthorisationNotificationType
{
	Unknown,
	GotKeycard,
	AccessGranted,
}

import class AuthorisationNotificationViewData extends GenericNotificationViewData
{
	import var authType : gameuiAuthorisationNotificationType;
}

class AuthorisationNotificationEvent extends Event
{
	var type : gameuiAuthorisationNotificationType;
}

class AuthorisationNotificationQueue extends gameuiGenericNotificationGameController
{
	private editable var m_duration : Float;
	default m_duration = 2.0f;

	protected event OnAuthorisationNotification( evt : AuthorisationNotificationEvent )
	{
		var notificationData : gameuiGenericNotificationData;
		var userData : AuthorisationNotificationViewData;
		switch( evt.type )
		{
			case gameuiAuthorisationNotificationType.GotKeycard:
				notificationData.widgetLibraryItemName = 'access_card_obtained';
			break;
			case gameuiAuthorisationNotificationType.AccessGranted:
				notificationData.widgetLibraryItemName = 'access_granted';
			break;
			default:
				break;
		}
		userData = new AuthorisationNotificationViewData;
		userData.authType = evt.type;
		notificationData.time = m_duration;
		notificationData.notificationData = userData;
		AddNewNotificationData( notificationData );
	}

}

class AuthorisationNotification extends GenericNotificationController
{

	public export override function SetNotificationData( notificationData : GenericNotificationViewData )
	{
		var authData : AuthorisationNotificationViewData;
		authData = ( ( AuthorisationNotificationViewData )( notificationData ) );
		switch( authData.authType )
		{
			case gameuiAuthorisationNotificationType.GotKeycard:
				PlayLibraryAnimation( 'anim_card_obtained' );
			break;
			case gameuiAuthorisationNotificationType.AccessGranted:
				PlayLibraryAnimation( 'anim_access_granted' );
			break;
			default:
				break;
		}
	}

}

