class SlidingLadderController extends BaseAnimatedDeviceController
{

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

}

class SlidingLadderControllerPS extends BaseAnimatedDeviceControllerPS
{
	default m_deviceName = "LocKey#2128";
	default m_tweakDBRecord = T"Devices.SlidingLadder";
	default m_tweakDBDescriptionRecord = T"device_descriptions.SlidingLadder";
	default m_shouldScannerShowStatus = false;
	protected instanceeditable var m_isShootable : Bool;
	default m_isShootable = true;
	protected instanceeditable var m_animationTime : Float;
	default m_animationTime = 1.0f;

	public override function GetActions( out actions : array< DeviceAction >, context : GetActionsContext ) : Bool
	{
		if( m_hasInteraction && IsNotActive() )
		{
			actions.PushBack( ActionToggleActivate() );
		}
		else if( IsActive() && EnterLadder.IsPlayerInAcceptableState( this, context ) )
		{
			actions.PushBack( ActionEnterLadder() );
		}
		SetActionIllegality( actions, m_illegalActions.regularActions );
		return true;
	}

	protected override function GetQuickHackActions( out actions : array< DeviceAction >, const context : ref< GetActionsContext > ) {}

	protected const override function CanCreateAnyQuickHackActions() : Bool
	{
		return false;
	}

	public function SetActive()
	{
		SetActiveState( true );
		m_activationState = EActivationState.ACTIVATED;
	}

	public function IsShootable() : Bool
	{
		return m_isShootable;
	}

	public function GetAnimTime() : Float
	{
		return m_animationTime;
	}

	protected function ActionEnterLadder() : EnterLadder
	{
		var action : EnterLadder;
		action = new EnterLadder;
		action.SetUp( this );
		action.SetProperties();
		action.AddDeviceName( m_deviceName );
		action.CreateInteraction();
		return action;
	}

	public function OnEnterLadder( evt : EnterLadder ) : EntityNotificationType
	{
		EnterLadder.PushOnEnterLadderEventToPSM( GetPlayerMainObject() );
		return EntityNotificationType.SendThisEventToEntity;
	}

}

