class RevealEnemies extends ActionBool
{

	public function SetProperties( reveal : Bool )
	{
		actionName = 'RevealEnemies';
		prop = DeviceActionPropertyFunctions.SetUpProperty_Bool( 'RevealEnemies', reveal, 'LocKey#17840', 'LocKey#17850' );
	}

}

class SurveillanceSystemController extends DeviceSystemBaseController
{

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

}

class SurveillanceSystemControllerPS extends DeviceSystemBaseControllerPS
{
	default m_tweakDBRecord = T"Devices.SurveillanceSystem";
	default m_tweakDBDescriptionRecord = T"device_descriptions.SurveillanceSystem";
	default m_deviceName = "LocKey#50770";
	private var m_isRevealingEnemies : Bool;

	protected event OnInstantiated()
	{
		super.OnInstantiated();
		if( !( IsStringValid( m_deviceName ) ) )
		{
			m_deviceName = "LocKey#50770";
		}
	}

	protected override function Initialize()
	{
		super.Initialize();
	}

	private virtual function ActionRevealEnemies() : RevealEnemies
	{
		var action : RevealEnemies;
		action = new RevealEnemies;
		action.SetUp( this );
		action.SetProperties( m_isRevealingEnemies );
		action.AddDeviceName( m_deviceName );
		return action;
	}

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

	public function OnRevealEnemies( evt : RevealEnemies ) : EntityNotificationType
	{
		var mySlaves : array< DeviceComponentPS >;
		var i : Int32;
		mySlaves = GetImmediateSlaves();
		m_isRevealingEnemies = !( m_isRevealingEnemies );
		for( i = 0; i < mySlaves.Size(); i += 1 )
		{
			( ( SurveillanceCameraControllerPS )( mySlaves[ i ] ) ).ForceRevealEnemies( m_isRevealingEnemies );
		}
		UseNotifier( evt );
		return EntityNotificationType.DoNotNotifyEntity;
	}

}

