class ElevatorFloorTerminal extends Terminal
{
	default m_controllerTypeName = 'ElevatorFloorTerminalController';

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

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

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

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

	protected event OnPerformedAction( evt : PerformedAction )
	{
		super.OnPerformedAction( evt );
		GameObject.PlayMetadataEvent( this, 'ui_generic_set_14_positive' );
	}

	private override function InitializeScreenDefinition()
	{
		if( !( TDBID.IsValid( m_screenDefinition.screenDefinition ) ) )
		{
			m_screenDefinition.screenDefinition = T"DevicesUIDefinitions.Terminal_9x16";
		}
		if( !( TDBID.IsValid( m_screenDefinition.style ) ) )
		{
			m_screenDefinition.style = T"DevicesUIStyles.Zetatech";
		}
	}

	public override function OnMaraudersMapDeviceDebug( sink : MaraudersMapDevicesSink )
	{
		var iter : Int32;
		var elevatorFloorSetup : ElevatorFloorSetup;
		var doorShouldOpenFrontLeftRight : array< Bool >;
		var keycards : array< TweakDBID >;
		super.OnMaraudersMapDeviceDebug( sink );
		sink.BeginCategory( "LIFT TERMINAL DEVICE" );
		sink.EndCategory();
		elevatorFloorSetup = GetDevicePS().GetElevatorFloorSetup();
		doorShouldOpenFrontLeftRight = elevatorFloorSetup.doorShouldOpenFrontLeftRight;
		keycards = GetDevicePS().GetKeycards();
		sink.PushString( "Marker ", ( ( String )( elevatorFloorSetup.m_floorMarker ) ) );
		sink.PushBool( "Is Hidden", elevatorFloorSetup.m_isHidden );
		sink.PushBool( "Is Inactive", elevatorFloorSetup.m_isInactive );
		sink.PushString( "Floor Name", elevatorFloorSetup.m_floorName );
		sink.PushString( "Floor Display Name", NameToString( elevatorFloorSetup.m_floorDisplayName ) );
		sink.PushString( "Is Elevator at this floor", ( ( String )( GetDevicePS().IsElevatorAtThisFloor() ) ) );
		sink.PushString( "Doors opening on that floor", "" );
		for( iter = 0; iter < doorShouldOpenFrontLeftRight.Size(); iter = iter + 1 )
		{
			sink.PushBool( "Door " + IntToString( iter ), doorShouldOpenFrontLeftRight[ iter ] );
		}
		sink.PushString( "KEYCARDS: ", "" );
		for( iter = 0; iter < keycards.Size(); iter = iter + 1 )
		{
			sink.PushString( ( "Keycard" + IntToString( iter ) ) + " ", TDBID.ToStringDEBUG( keycards[ iter ] ) );
		}
	}

	protected override function ShouldAlwasyRefreshUIInLogicAra() : Bool
	{
		return true;
	}

}

