class Toilet extends InteractiveDevice
{
	default m_controllerTypeName = 'ToiletController';

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

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

	protected event OnFlush( evt : Flush )
	{
		if( evt.IsStarted() )
		{
			PlaySoundEvent( this, ( ( ToiletControllerPS )( GetDevicePS() ) ).GetFlushSFX() );
			GameObjectEffectHelper.StartEffectEvent( this, ( ( ToiletControllerPS )( GetDevicePS() ) ).GetFlushVFX() );
		}
		else
		{
			GameObjectEffectHelper.StopEffectEvent( this, ( ( ToiletControllerPS )( GetDevicePS() ) ).GetFlushVFX() );
		}
		UpdateDeviceState();
	}

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

	protected const override function GetController() : ToiletController
	{
		return ( ( ToiletController )( m_controller ) );
	}

	public const override function DeterminGameplayRole() : EGameplayRole
	{
		return EGameplayRole.GenericRole;
	}

}

