class Wardrobe extends InteractiveDevice
{
	default m_controllerTypeName = 'WardrobeController';

	protected event OnRequestComponents( ri : EntityRequestComponentsInterface )
	{
		super.OnRequestComponents( ri );
	}

	protected event OnTakeControl( ri : EntityResolveComponentsInterface )
	{
		super.OnTakeControl( ri );
		m_controller = ( ( WardrobeController )( EntityResolveComponentsInterface.GetComponent( ri, 'controller' ) ) );
	}

	protected event OnGameAttached()
	{
		super.OnGameAttached();
	}

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

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

	protected event OnInteractionActivated( evt : InteractionActivationEvent )
	{
		var actorUpdateData : HUDActorUpdateData;
		super.OnInteractionActivated( evt );
		if( evt.eventType == gameinteractionsEInteractionEventType.EIET_activate )
		{
			if( evt.layerData.tag == 'LogicArea' )
			{
				actorUpdateData = new HUDActorUpdateData;
				actorUpdateData.updateIsInIconForcedVisibilityRange = true;
				actorUpdateData.isInIconForcedVisibilityRangeValue = true;
				RequestHUDRefresh( actorUpdateData );
			}
		}
		else
		{
			if( evt.layerData.tag == 'LogicArea' )
			{
				actorUpdateData = new HUDActorUpdateData;
				actorUpdateData.updateIsInIconForcedVisibilityRange = true;
				actorUpdateData.isInIconForcedVisibilityRangeValue = false;
				RequestHUDRefresh( actorUpdateData );
			}
		}
	}

	private const override function GetController() : WardrobeController
	{
		return ( ( WardrobeController )( m_controller ) );
	}

	public const override function GetDevicePS() : WardrobeControllerPS
	{
		return GetController().GetPS();
	}

	public const override function IsWardrobe() : Bool
	{
		return true;
	}

	public const override function DeterminGameplayRoleMappinVisuaState( const data : ref< SDeviceMappinData > ) : EMappinVisualState
	{
		return EMappinVisualState.Default;
	}

	public const override function DeterminGameplayRole() : EGameplayRole
	{
		if( GetDevicePS().HasInteraction() )
		{
			return EGameplayRole.Wardrobe;
		}
		else
		{
			return EGameplayRole.None;
		}
	}

}

class WardrobeController extends ScriptableDeviceComponent
{

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

}

