class FanController extends BasicDistractionDeviceController
{

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

}

struct FanSetup
{
	instanceeditable var m_animationType : EAnimationType;
	instanceeditable var m_rotateClockwise : Bool;
	default m_rotateClockwise = true;
	instanceeditable var m_randomizeBladesSpeed : Bool;
	default m_randomizeBladesSpeed = false;
	[ rangeMin = "1" ][ rangeMax = "300" ]
	instanceeditable persistent var m_maxRotationSpeed : Float;
	default m_maxRotationSpeed = 150.f;
	[ rangeMin = "0.0f" ][ rangeMax = "5.0f" ]
	instanceeditable var m_timeToMaxRotation : Float;
	default m_timeToMaxRotation = 3.f;
}

class FanControllerPS extends BasicDistractionDeviceControllerPS
{
	default m_deviceName = "LocKey#94";
	default m_tweakDBRecord = T"Devices.Fan";
	default m_tweakDBDescriptionRecord = T"device_descriptions.Fan";
	private instanceeditable persistent var m_fanSetup : FanSetup;

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

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

	public const function IsRotatingClockwise() : Bool
	{
		return m_fanSetup.m_rotateClockwise;
	}

	public const function IsBladesSpeedRandomized() : Bool
	{
		return m_fanSetup.m_randomizeBladesSpeed;
	}

	public const function GetMaxRotationSpeed() : Float
	{
		return m_fanSetup.m_maxRotationSpeed;
	}

	public const function GetTimeToMaxRotation() : Float
	{
		return m_fanSetup.m_timeToMaxRotation;
	}

	public export function PushResaveData( data : FanResaveData ) {}

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

	protected override function GetDeviceIconTweakDBID() : TweakDBID
	{
		return T"DeviceIcons.VentilationDeviceIcon";
	}

	protected override function GetBackgroundTextureTweakDBID() : TweakDBID
	{
		return T"DeviceIcons.VentilationDeviceBackground";
	}

}

