class GetAccess extends ActionBool
{

	public function SetProperties( hasAccess : Bool )
	{
		actionName = 'GetAccess';
		prop = DeviceActionPropertyFunctions.SetUpProperty_Bool( 'GetAccess', hasAccess, 'LocKey#17838', 'LocKey#17839' );
	}

}

abstract class DeviceSystemBaseController extends MasterController
{

	public const override function GetPS() : DeviceSystemBaseControllerPS
	{
		return ( ( DeviceSystemBaseControllerPS )( GetBasePS() ) );
	}

}

abstract class DeviceSystemBaseControllerPS extends MasterControllerPS
{
	default m_deviceName = "BaseDeviceSystemControllerPS";
	protected persistent var m_quickHacksEnabled : Bool;

	protected virtual function ActionGetAccess() : GetAccess
	{
		var action : GetAccess;
		action = new GetAccess;
		action.SetUp( this );
		action.SetProperties( m_quickHacksEnabled );
		action.AddDeviceName( m_deviceName );
		return action;
	}

	public override function GetActions( out outActions : array< DeviceAction >, context : GetActionsContext ) : Bool
	{
		if( !( super.GetActions( outActions, context ) ) )
		{
			return false;
		}
		if( GetAccess.IsDefaultConditionMet( this, context ) )
		{
			outActions.PushBack( ActionGetAccess() );
		}
		SetActionIllegality( outActions, m_illegalActions.regularActions );
		return true;
	}

	public function OnGetAccess( evt : GetAccess ) : EntityNotificationType
	{
		var mySlaves : array< DeviceComponentPS >;
		var i : Int32;
		mySlaves = GetImmediateSlaves();
		m_quickHacksEnabled = !( m_quickHacksEnabled );
		for( i = 0; i < mySlaves.Size(); i += 1 )
		{
			mySlaves[ i ].ExposeQuickHacks( true );
			RevokeQuickHacks( mySlaves[ i ] );
		}
		UseNotifier( evt );
		return EntityNotificationType.DoNotNotifyEntity;
	}

	private function RevokeQuickHacks( device : DeviceComponentPS )
	{
		var revokeEvent : RevokeQuickHackAccess;
		revokeEvent = new RevokeQuickHackAccess;
		GameInstance.GetDelaySystem( GetGameInstance() ).DelayPSEvent( device.GetID(), device.GetClassName(), revokeEvent, 60.0 );
	}

}

