class VirtualItem_TEMP extends GameObject
{
	editable var m_item : String;
	var m_interaction : InteractionComponent;
	var m_mesh : PhysicalMeshComponent;
	var m_mesh1 : PhysicalMeshComponent;
	var m_mesh2 : PhysicalMeshComponent;
	var m_mesh3 : PhysicalMeshComponent;
	var m_mesh4 : PhysicalMeshComponent;

	protected event OnRequestComponents( ri : EntityRequestComponentsInterface )
	{
		EntityRequestComponentsInterface.RequestComponent( ri, 'interaction', 'InteractionComponent', true );
		EntityRequestComponentsInterface.RequestComponent( ri, 'mesh', 'PhysicalMeshComponent', true );
		EntityRequestComponentsInterface.RequestComponent( ri, 'mesh1', 'PhysicalMeshComponent', true );
		EntityRequestComponentsInterface.RequestComponent( ri, 'mesh2', 'PhysicalMeshComponent', true );
		EntityRequestComponentsInterface.RequestComponent( ri, 'mesh3', 'PhysicalMeshComponent', true );
		EntityRequestComponentsInterface.RequestComponent( ri, 'mesh4', 'PhysicalMeshComponent', true );
		EntityRequestComponentsInterface.RequestComponent( ri, 'visionMode', 'gameVisionModeComponent', true );
	}

	protected event OnTakeControl( ri : EntityResolveComponentsInterface )
	{
		m_interaction = ( ( InteractionComponent )( EntityResolveComponentsInterface.GetComponent( ri, 'interaction' ) ) );
		m_mesh = ( ( PhysicalMeshComponent )( EntityResolveComponentsInterface.GetComponent( ri, 'mesh' ) ) );
		m_mesh1 = ( ( PhysicalMeshComponent )( EntityResolveComponentsInterface.GetComponent( ri, 'mesh1' ) ) );
		m_mesh2 = ( ( PhysicalMeshComponent )( EntityResolveComponentsInterface.GetComponent( ri, 'mesh2' ) ) );
		m_mesh3 = ( ( PhysicalMeshComponent )( EntityResolveComponentsInterface.GetComponent( ri, 'mesh3' ) ) );
		m_mesh4 = ( ( PhysicalMeshComponent )( EntityResolveComponentsInterface.GetComponent( ri, 'mesh4' ) ) );
	}

	protected event OnGameAttached()
	{
		var choice : InteractionChoice;
		choice.choiceMetaData.tweakDBName = "Loot";
		m_interaction.SetSingleChoice( choice );
	}

	protected event OnInteractionChoice( choice : InteractionChoiceEvent )
	{
		HideVirtualItem();
		TransferItem( choice.activator );
	}

	private function TransferItem( activator : GameObject )
	{
		var transSystem : TransactionSystem;
		transSystem = GameInstance.GetTransactionSystem( GetGame() );
		transSystem.GiveItem( activator, ItemID.FromTDBID( TDBID.Create( m_item ) ), 1 );
	}

	private function HideVirtualItem()
	{
		var state : InteractionSetEnableEvent;
		state = new InteractionSetEnableEvent;
		state.enable = false;
		this.QueueEvent( state );
		m_mesh.CreatePhysicalBodyInterface().SetIsQueryable( false );
		m_mesh.Toggle( false );
		m_mesh1.CreatePhysicalBodyInterface().SetIsQueryable( false );
		m_mesh1.Toggle( false );
		m_mesh2.CreatePhysicalBodyInterface().SetIsQueryable( false );
		m_mesh2.Toggle( false );
		m_mesh3.CreatePhysicalBodyInterface().SetIsQueryable( false );
		m_mesh3.Toggle( false );
		m_mesh4.CreatePhysicalBodyInterface().SetIsQueryable( false );
		m_mesh4.Toggle( false );
	}

}

