class NetworkArea extends InteractiveMasterDevice
{
	default m_controllerTypeName = 'NetworkAreaController';
	private var m_area : TriggerComponent;

	protected event OnRequestComponents( ri : EntityRequestComponentsInterface )
	{
		EntityRequestComponentsInterface.RequestComponent( ri, 'area', 'TriggerComponent', false );
		super.OnRequestComponents( ri );
	}

	protected event OnTakeControl( ri : EntityResolveComponentsInterface )
	{
		super.OnTakeControl( ri );
		m_area = ( ( TriggerComponent )( EntityResolveComponentsInterface.GetComponent( ri, 'area' ) ) );
		m_controller = ( ( NetworkAreaController )( EntityResolveComponentsInterface.GetComponent( ri, 'controller' ) ) );
	}

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

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

	protected event OnAreaEnter( evt : AreaEnteredEvent )
	{
		var entityID : EntityID;
		entityID = ExtractEntityID( evt );
		if( IsPlayer( entityID ) )
		{
			GetDevicePS().AreaEntered();
		}
	}

	protected event OnAreaExit( evt : AreaExitedEvent )
	{
		var entityID : EntityID;
		entityID = ExtractEntityID( evt );
		if( IsPlayer( entityID ) )
		{
			GetDevicePS().AreaExited();
		}
	}

}

