class HoloFeeder extends InteractiveDevice
{
	default m_controllerTypeName = 'HoloFeederController';
	private var m_feederMesh : IPlacedComponent;
	private var m_feederMesh1 : IPlacedComponent;

	protected event OnRequestComponents( ri : EntityRequestComponentsInterface )
	{
		super.OnRequestComponents( ri );
		EntityRequestComponentsInterface.RequestComponent( ri, 'feeder', 'IPlacedComponent', true );
		EntityRequestComponentsInterface.RequestComponent( ri, 'feeder_1', 'IPlacedComponent', false );
	}

	protected event OnTakeControl( ri : EntityResolveComponentsInterface )
	{
		super.OnTakeControl( ri );
		m_controller = ( ( HoloFeederController )( EntityResolveComponentsInterface.GetComponent( ri, 'controller' ) ) );
		m_feederMesh = ( ( IPlacedComponent )( EntityResolveComponentsInterface.GetComponent( ri, 'feeder' ) ) );
		m_feederMesh1 = ( ( IPlacedComponent )( EntityResolveComponentsInterface.GetComponent( ri, 'feeder_1' ) ) );
	}

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

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

	protected override function CutPower()
	{
		TurnOff();
	}

	protected override function TurnOnDevice()
	{
		TurnOn();
	}

	protected override function TurnOffDevice()
	{
		TurnOff();
	}

	private function TurnOn()
	{
		m_feederMesh.Toggle( true );
		if( m_feederMesh1 )
		{
			m_feederMesh1.Toggle( true );
		}
		PlaySoundEvent( this, GetDevicePS().GetOnSound() );
	}

	private function TurnOff()
	{
		m_feederMesh.Toggle( false );
		if( m_feederMesh1 )
		{
			m_feederMesh1.Toggle( false );
		}
		PlaySoundEvent( this, GetDevicePS().GetOffSound() );
	}

}

